Skip to content

Name the pkgdown destination in CI as well as in the config #2

Name the pkgdown destination in CI as well as in the config

Name the pkgdown destination in CI as well as in the config #2

Workflow file for this run

name: pkgdown
# Builds the reference site and publishes it to GitHub Pages. Unlike the check
# and citation workflows this one is not shared from chross22/distsamp, since
# no reusable pkgdown workflow exists there yet.
on:
push:
branches: [main, master]
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
concurrency:
group: pkgdown-${{ github.ref }}
cancel-in-progress: true
jobs:
pkgdown:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
# sf and terra need these to build from source on Linux.
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgdal-dev libgeos-dev libproj-dev libudunits2-dev
- 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, local::.
needs: website
- name: Build site
# dest_dir must be named: build_site_github_pages() defaults to docs/ and
# ignores the destination: key in _pkgdown.yml, so it would try to clean a
# directory that holds hand-written notes in several of these repos.
run: pkgdown::build_site_github_pages(dest_dir = "pkgdown-site", new_process = FALSE, install = FALSE)
shell: Rscript {0}
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4.5.0
with:
clean: false
branch: gh-pages
folder: pkgdown-site