Skip to content

Commit

Permalink
bookdwon.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
edwbaker committed Dec 18, 2023
1 parent 9ccbf11 commit ef569f9
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 48 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/bookdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# 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 }}
48 changes: 0 additions & 48 deletions .github/workflows/pkgdown.yaml

This file was deleted.

0 comments on commit ef569f9

Please sign in to comment.