Skip to content

Merge pull request #145 from sfcheung/devel #76

Merge pull request #145 from sfcheung/devel

Merge pull request #145 from sfcheung/devel #76

Workflow file for this run

# 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
on:
push:
branches: [main, master]
release:
types: [published]
workflow_dispatch:
name: pkgdown
jobs:
pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, any::XML, any::DiagrammeR, local::.
needs: website
- name: Update mermaid
run: |
# Adapted from https://github.com/rich-iannone/DiagrammeR/issues/457#issuecomment-1109995343
mm_loc <- list.files(
find.package("DiagrammeR"),
recursive = TRUE,
pattern = "mermaid.*js",
full.names = TRUE
)
mm_dir <- dirname(mm_loc)
mm_loc_old <- file.path(mm_dir, "mm.old")
mm_loc_new <- file.path(mm_dir, "mm.new")
file.copy(mm_loc, mm_loc_old, overwrite = TRUE)
mm_url <- "https://cdnjs.cloudflare.com/ajax/libs/mermaid/9.0.1/mermaid.min.js"
utils::download.file(mm_url, mm_loc_new)
file.copy(mm_loc_new, mm_loc, overwrite = TRUE)
shell: Rscript {0}
- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@v4.4.1
with:
clean: false
branch: gh-pages
folder: docs