Skip to content

Commit

Permalink
Update GHA workflow (#1457)
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Feb 29, 2024
1 parent ad074bb commit afb90ba
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/Book.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ on:

name: Build and deploy book

concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: macOS-latest
Expand All @@ -38,7 +45,7 @@ jobs:

steps:
- name: Checkout Repo
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install R
uses: r-lib/actions/setup-r@v2
Expand All @@ -47,7 +54,7 @@ jobs:
uses: r-lib/actions/setup-pandoc@v2
with:
# install nightly when checking on gh-pages
pandoc-version: ${{ github.event.inputs.ghpages && 'nightly' || '2.17.1.1' }}
pandoc-version: ${{ github.event.inputs.ghpages && 'nightly' || '2.17.1.1'}
token: ${{ secrets.GITHUB_TOKEN }}

- name: Install TinyTeX
Expand All @@ -73,7 +80,7 @@ jobs:
shell: Rscript {0}

- name: Cache bookdown results
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: inst/examples/_bookdown_files
key: bookdown-${{ hashFiles('inst/examples/*Rmd') }}
Expand All @@ -98,7 +105,7 @@ jobs:

- name: Deploy Gitbook to gh-pages
if: github.event_name == 'workflow_dispatch' && github.event.inputs.ghpages
uses: JamesIves/github-pages-deploy-action@4.1.5
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: inst/examples/_book
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ on:

name: R-CMD-check

concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand Down Expand Up @@ -84,7 +91,7 @@ jobs:
cat(readLines("~/.Rprofile"), sep = "\n")
shell: Rscript {0}

- uses: r-lib/actions/setup-r-dependencies@v2
- uses: r-lib/actions/setup-r-dependencies@v2-branch
with:
extra-packages: any::rcmdcheck
needs: check
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/lock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@v5
with:
github-token: ${{ github.token }}
process-only: 'issues, prs'
issue-inactive-days: '180'
# exclude-issue-created-before: ''
# exclude-issue-created-after: ''
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ on:

name: pkgdown

concurrency:
# Use github.run_id on main branch
# Use github.event.pull_request.number on pull requests, so it's unique per pull request
# Use github.ref on other branches, so it's unique per branch
group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_id || github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
pkgdown:
if: ${{ github.event_name == 'push' || startsWith(github.head_ref, 'pkgdown/') }}
Expand All @@ -21,7 +28,7 @@ jobs:
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

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

Expand All @@ -35,7 +42,7 @@ jobs:
needs: website

- name: Cache some pkgdown assets
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: |
vignettes/articles/images/*.png
Expand All @@ -47,7 +54,7 @@ jobs:

- name: Deploy to Netlify
id: netlify-deploy
uses: nwtgck/actions-netlify@v1.1
uses: nwtgck/actions-netlify@v2
with:
publish-dir: 'reference'
production-branch: main
Expand Down

0 comments on commit afb90ba

Please sign in to comment.