Merge branch 'master' of https://github.com/audioblast/docs.audioblas… #1
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: | |
jobs: | |
CI-CD: | |
runs-on: ${{ matrix.config.os }} | |
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | |
strategy: | |
# We keep a matrix for convenience, but we would always want to run on one | |
# single OS and R version | |
matrix: | |
config: | |
- {os: ubuntu-latest, r: 'release'} | |
env: | |
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- uses: r-lib/actions/setup-pandoc@v2 | |
- name: Setup R | |
uses: r-lib/actions/setup-r@v2 | |
with: | |
r-version: ${{ matrix.config.r }} | |
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-artifact@v1 | |
with: | |
name: site | |
path: _book | |
- name: Test website | |
uses: docker://klakegg/html-proofer:3.18.8 | |
with: | |
args: _book | |
- name: Deploy to GitHub Pages | |
if: github.ref == 'refs/heads/master' | |
# TODO: consider switching to JamesIves/github-pages-deploy-action | |
# uses: JamesIves/[email protected] | |
# with: | |
# branch: gh-pages | |
# folder: _book | |
uses: crazy-max/[email protected] | |
with: | |
target_branch: gh-pages | |
build_dir: _book | |
jekyll: false | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |