Merge pull request #2 from bbuchsbaum/gauntlet-integration #2
This file contains hidden or 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
| name: Documentation | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| # Never cancel a deployment that is already publishing. | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: false | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
| R_KEEP_PKG_SOURCE: yes | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - uses: r-lib/actions/setup-r-dependencies@v2 | |
| with: | |
| # Swap to `any::starlightdown` once it is on CRAN. | |
| extra-packages: | | |
| bbuchsbaum/starlightdown | |
| local::. | |
| needs: website | |
| # Vignettes are rendered with Quarto. Reference-only sites do not need it, | |
| # but leaving it installed costs a few seconds and avoids a confusing | |
| # failure the first time someone adds a vignette. | |
| - uses: quarto-dev/quarto-actions/setup@v2 | |
| # build_site() executes examples and vignettes against the *installed* | |
| # package, so install it first. | |
| - name: Install package | |
| run: R CMD INSTALL . | |
| - name: Build documentation | |
| run: Rscript -e 'starlightdown::build_site()' | |
| - name: Add generated plot alternatives | |
| run: Rscript tools/postprocess-starlight.R | |
| - name: Check for lockfile | |
| run: | | |
| if [ ! -f starlight/package-lock.json ]; then | |
| echo "::error::starlight/package-lock.json is missing." | |
| echo "The scaffold ships one; restore it, or run 'npm install' in starlight/ and commit the result." | |
| exit 1 | |
| fi | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: npm | |
| cache-dependency-path: starlight/package-lock.json | |
| - name: Install Node dependencies | |
| run: npm ci --prefix starlight | |
| - name: Build Starlight site | |
| run: npm run build --prefix starlight | |
| - name: Verify advertised routes and page identity | |
| run: Rscript tools/check-starlight-site.R | |
| - uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: starlight/dist | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |