One last update to remove post-its from instructions (copied from pal… #232
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
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: main | |
| name: Quarto Publish | |
| jobs: | |
| build-deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Check out repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Quarto | |
| uses: quarto-dev/quarto-actions/setup@v2 | |
| - name: Setup R | |
| uses: r-lib/actions/setup-r@v2 | |
| # modified from https://github.com/r-lib/actions/blob/v2-branch/setup-renv/action.yaml | |
| - name: Set RENV_PATHS_ROOT | |
| shell: bash | |
| run: | | |
| echo "RENV_PATHS_ROOT=${{ runner.temp }}/renv" >> $GITHUB_ENV | |
| - name: Install and activate renv | |
| run: | | |
| if (!requireNamespace("renv", quietly=TRUE)) install.packages("renv") | |
| renv::activate(profile = ${{ inputs.profile }}) | |
| shell: Rscript {0} | |
| - name: Get R and OS version | |
| id: get-version | |
| run: | | |
| cat("os-version=", sessionInfo()$running, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) | |
| cat("r-version=", R.Version()$version.string, "\n", file = Sys.getenv("GITHUB_OUTPUT"), sep = "", append = TRUE) | |
| shell: Rscript {0} | |
| - name: Restore Renv package cache | |
| id: cache-packages-restore | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: | | |
| ${{ env.RENV_PATHS_ROOT }} | |
| renv/library | |
| key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-${{ hashFiles('renv.lock') }} | |
| restore-keys: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}- | |
| - name: Install dependencies with renv and pak | |
| run: | | |
| install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/") | |
| options(renv.config.pak.enabled = TRUE) | |
| renv::install(unique(renv::dependencies()$Package)) | |
| renv::install(c("knitr", "rmarkdown")) | |
| renv::snapshot(force = TRUE) | |
| shell: Rscript {0} | |
| - name: Don't use tar 1.30 from Rtools35 to store the cache | |
| shell: bash | |
| run: | | |
| if command -v /c/Rtools/bin/tar && /c/Rtools/bin/tar --version | grep -q 'tar (GNU tar) 1.30' | |
| then echo 'C:/Program Files/Git/usr/bin' >> $GITHUB_PATH | |
| fi | |
| - name: Save Renv package cache | |
| if: ${{ always() }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: | | |
| ${{ env.RENV_PATHS_ROOT }} | |
| renv/library | |
| key: ${{ steps.get-version.outputs.os-version }}-${{ steps.get-version.outputs.r-version }}-${{inputs.cache-version }}-${{ hashFiles('renv.lock') }} | |
| # end modified steps | |
| - name: Render Quarto Project | |
| uses: quarto-dev/quarto-actions/render@v2 | |
| - name: Rename .gitignore | |
| run: mv .gitignore .gitignore_tmp | |
| - name: Save _freeze folder | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| if: ${{ always() }} | |
| with: | |
| commit_message: Update _freeze | |
| file_pattern: '_freeze' | |
| add_options: '-f' | |
| - name: Rename .gitignore back | |
| run: mv .gitignore_tmp .gitignore | |
| - name: Publish | |
| uses: quarto-dev/quarto-actions/publish@v2 | |
| with: | |
| target: gh-pages | |
| render: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |