Skip to content

Commit

Permalink
Update pkgdown Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
dfsnow committed Jul 14, 2023
1 parent 0299012 commit 658bc0c
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# 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:
workflow_dispatch:
pull_request:
Expand All @@ -14,32 +12,25 @@ jobs:
uses: ./.github/workflows/prepare-ptaxsim.yaml
secrets: inherit

pkgdown:
build-pkgdown-site:
needs: prepare-ptaxsim
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
PTAXSIM_DB_PATH: ${{ github.workspace }}/ptaxsim.db
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
cancel-in-progress: false
permissions:
contents: read
pages: write
id-token: write
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v3

- uses: r-lib/actions/setup-pandoc@v2
- name: Setup pandoc
uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
- name: Setup R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
- name: Setup R dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
needs: website
Expand All @@ -57,7 +48,7 @@ jobs:
pbzip2 -d ptaxsim.db.bz2
shell: bash

- name: Build site
- name: Build pkgdown site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

Expand All @@ -69,6 +60,17 @@ jobs:
with:
path: 'docs'

deploy:
if: contains(fromJSON('["main", "master"]'), github.ref_name) && github.event_name != 'pull_request'
needs: build-pkgdown-site
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2

0 comments on commit 658bc0c

Please sign in to comment.