-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a41538b
commit 9605081
Showing
1 changed file
with
23 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] | ||
|