Link glossary terms in website pages (#40) #61
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: Render and Deploy | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| render: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| has-artifacts: ${{ steps.check-outputs.outputs.has-artifacts }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| with: | |
| version: "1.8.24" | |
| tinytex: true | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| with: | |
| use-public-rspm: true | |
| - name: Install R packages | |
| run: Rscript -e 'install.packages(c("DT", "htmltools"))' | |
| - name: Install Quarto extensions | |
| run: quarto add kapsner/authors-block --no-prompt | |
| working-directory: manuscript | |
| - name: Render manuscript | |
| run: quarto render manuscript/index.qmd | |
| - name: Render website | |
| run: quarto render | |
| - name: Add paper to site | |
| run: | | |
| mkdir -p _site/paper | |
| cp manuscript/index.html \ | |
| _site/paper/index.html 2>/dev/null || true | |
| cp manuscript/index.pdf \ | |
| _site/paper/index.pdf 2>/dev/null || true | |
| cp -r manuscript/*_files \ | |
| _site/paper/ 2>/dev/null || true | |
| - name: Check for outputs | |
| id: check-outputs | |
| run: | | |
| if [ -d "_site" ]; then | |
| echo "has-artifacts=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "has-artifacts=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Upload site preview | |
| if: steps.check-outputs.outputs.has-artifacts == 'true' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: site-preview-${{ github.sha }} | |
| path: _site | |
| retention-days: 30 | |
| if-no-files-found: warn | |
| - name: Setup Pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/configure-pages@v4 | |
| - name: Upload to GitHub Pages | |
| if: github.ref == 'refs/heads/main' | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| deploy: | |
| if: > | |
| github.ref == 'refs/heads/main' && | |
| needs.render.outputs.has-artifacts == 'true' | |
| environment: | |
| name: github-pages | |
| url: ${{ steps.deployment.outputs.page_url }} | |
| runs-on: ubuntu-latest | |
| needs: render | |
| steps: | |
| - name: Deploy to GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |