Skip to content

Commit

Permalink
edit gha test render workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestguevarra committed Jan 22, 2025
1 parent a41538b commit 9605081
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions .github/workflows/netlify.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,43 @@
name: Test book render

on:
pull_request:
branches: [main, master]

name: pkgdown-pr
workflow_dispatch:

jobs:
netlify:
test-book-render:
runs-on: ubuntu-latest
container: rocker/tidyverse:4.4.2
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- name: Install system dependencies
run: |
apt-get update && apt-get install -y --no-install-recommends \
libxt6 libglpk-dev gh curl jq
- uses: r-lib/actions/setup-tinytex@v2

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
use-public-rspm: true
tinytex: true

- uses: r-lib/actions/setup-r-dependencies@v2
- name: Install packages from renv.lock (with cache)
if: ${{ !env.ACT }}
uses: r-lib/actions/setup-renv@v2
with:
extra-packages: any::pkgdown, local::.
needs: website

- name: Install package
run: R CMD INSTALL .
cache-version: 2

- name: Create website
- name: Install packages from renv.lock (local, no cache)
if: ${{ env.ACT }}
run: |
pkgdown::build_site()
renv::restore()
shell: Rscript {0}

- name: Create index file
run: |
echo '<!DOCTYPE html><html><head><meta http-equiv="refresh" content="0;URL=/dev/index.html" /> <script language="javascript"> window.location.replace('/dev/index.html')</script></head></html>' > ./docs/index.html

- name: Render document
run: quarto render

- name: Deploy to Netlify
uses: nwtgck/[email protected]
Expand Down

0 comments on commit 9605081

Please sign in to comment.