Incorporate PR feedback #275
Workflow file for this run
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
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | |
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | |
name: CI-CD | |
on: | |
# Triggered on push and pull request events | |
push: | |
pull_request: | |
# Allow manual runs from the Actions tab | |
workflow_dispatch: | |
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
# Build job | |
build: | |
name: CI | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Setup Pages | |
uses: actions/configure-pages@v5 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: release | |
use-public-rspm: true | |
- name: Install and cache dependencies | |
uses: r-lib/actions/setup-r-dependencies@v2 | |
- name: Build site | |
run: | | |
bookdown::render_book("index.Rmd", "bookdown::gitbook") | |
shell: Rscript {0} | |
- name: Upload built site artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: _book | |
- name: Test website | |
uses: docker://klakegg/html-proofer:3.18.8 | |
with: | |
args: _book | |
# Deployment job | |
deploy: | |
name: CD | |
runs-on: ubuntu-latest | |
needs: build | |
if: github.ref == 'refs/heads/master' | |
# Allow one concurrent deployment | |
concurrency: | |
group: "pages" # fixed string ensures any execution of this job will share the same concurrency group | |
cancel-in-progress: false # don't cancel in-progress runs as we want to allow these production deployments to complete | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |