commit #19
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
name: Quarto Publish | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
schedule: | |
- cron: '0 23 * * *' # Optional: Daily at 11 PM | |
jobs: | |
build-deploy: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
env: | |
RUST_BACKTRACE: 1 # Optional: For detailed error reporting | |
steps: | |
# 1. Check out the repository | |
- name: Check out repository | |
uses: actions/checkout@v4 | |
# 2. Set up R with RSPM for faster package installations | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
use-public-rspm: true | |
# 3. Cache renv dependencies | |
- name: Cache renv dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
renv/library | |
renv/cache | |
key: ${{ runner.os }}-renv-${{ hashFiles('renv.lock') }} | |
restore-keys: | | |
${{ runner.os }}-renv- | |
# 4. Install renv | |
- name: Install renv | |
run: | | |
Rscript -e 'install.packages("renv")' | |
# 5. Restore renv environment | |
- name: Restore renv Environment | |
run: | | |
Rscript -e 'renv::restore()' | |
# 6. Set up Quarto | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
# 7. Render and Publish | |
- name: Render and Publish | |
uses: quarto-dev/quarto-actions/publish@v2 | |
with: | |
target: gh-pages | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |