Update main.yml #24
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: Render and Deploy All Quarto Documents | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
render: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.MY_GITHUB_PAT }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up R | |
uses: r-lib/actions/setup-r@v2 | |
# - name: Install R dependencies | |
# uses: r-lib/actions/setup-r-dependencies@v2 | |
# with: | |
# cache-version: 2 | |
# extra-packages: | | |
# any::ggplot2 | |
# any::rcmdcheck | |
# any::remotes | |
# any::rmarkdown | |
- name: Set up Quarto | |
uses: quarto-dev/quarto-actions/setup@v2 | |
- name: Install specific R packages | |
run: | | |
Rscript -e 'install.packages(c("rmarkdown", "ggplot2", "remotes"))' | |
Rscript -e 'remotes::install_github("tensorchiefs/data", subdir = "R/edudat", dependencies = TRUE, upgrade = "always", verbose = TRUE)' | |
- name: Render QMD files | |
run: | | |
quarto render data/*.qmd --to gfm | |
- name: Commit and push rendered files to docs branch | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git checkout docs | |
cp -r data/* . | |
git add . | |
git commit -m 'Update rendered documentation' | |
git push origin docs | |
env: | |
GITHUB_TOKEN: ${{ secrets.MY_GITHUB_PAT }} | |
# Optional deployment step, commented out for now | |
# - name: Deploy to GitHub Pages | |
# uses: peaceiris/actions-gh-pages@v3 | |
# with: | |
# personal_token: ${{ secrets.MY_GITHUB_PAT }} | |
# publish_dir: ./data | |
# publish_branch: gh-docs |