build_application #181
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
on: | |
repository_dispatch: | |
push: | |
branches: master | |
name: Render & Deploy Site | |
jobs: | |
build: | |
runs-on: macOS-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-r@v2 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Install dependencies, save github token for gh(), render site | |
run: | | |
github_token <- "${{ secrets.GITHUB_TOKEN }}" | |
install.packages(c("distill", "postcards", "devtools", | |
"fs", "htmltools", "here", "magick", "gh", "jsonlite", "echarts4r.assets")) | |
rmarkdown::render_site(encoding = "UTF-8") | |
shell: Rscript {0} | |
- name: Copy redirects and gallery images | |
run: Rscript -e 'fs::file_copy("_redirects", "_site/_redirects"); fs::dir_copy("_gallery/img", "_site/_gallery/img")' | |
- name: Get CV | |
run: Rscript -e 'devtools::source_url("https://github.com/etiennebacher/personal_website_distill/blob/master/R/get_cv.R?raw=TRUE")' | |
- name: Commit results | |
run: | | |
git add -A | |
git commit -m 'Rebuild site' || echo "No changes to commit" | |
git push origin || echo "No changes to commit" |