fix: wf install page no_render #296
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: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
inputs: | |
update_ref: | |
description: 'Update Reference triggered pg build' | |
required: false | |
default: 'false' | |
name: build_and_deploy_gh_pages | |
env: | |
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
blogdown: | |
name: build_and_push_to_gh_pages | |
if: "contains(toJSON(github.event.commits.*.message), 'pg_build') && ! contains(toJSON(github.event.commits.*.message), 'no_render')" | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: "recursive" | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Cache node dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.npm | |
key: node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
node- | |
- run: npm ci | |
- uses: r-lib/actions/setup-r@v1 | |
- uses: r-lib/actions/setup-pandoc@v1 | |
- name: Cache R packages | |
uses: actions/cache@v2 | |
with: | |
path: ${{ env.R_LIBS_USER }} | |
key: blogdown-1-dep | |
restore-keys: blogdown-1-dep | |
- name: Install system dependencies | |
run: bash .github/bash/install_system.sh | |
- name: Install R dependencies | |
run: Rscript R/solve_deps.R | |
- name: Install Hugo | |
run: | | |
Rscript -e 'install.packages("blogdown", repos = "http://cran.us.r-project.org")' | |
Rscript -e 'blogdown::install_hugo(extended = TRUE)' | |
- name: Run hugo_build() | |
run: | | |
Rscript -e 'blogdown::build_site(build_rmd = "md5sum")' | |
Rscript -e 'writeLines(as.character(Sys.time()), "blogdown/timestamp.txt")' | |
- name: Update github | |
run: | | |
git config --local user.name "Github Action Bot" | |
git config --local user.email "[email protected]" | |
git add -A | |
git commit -m "Bot update public and md5sum table" -a | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: ${{ github.ref }} | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
cname: systempipe.org | |
ph-pages: | |
name: gh_pages_only | |
if: "contains(toJSON(github.event.commits.*.message), 'no_render')" | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Deploy | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./public | |
cname: systempipe.org |