Skip to content

Commit

Permalink
Merge pull request #197 from Appsilon/update-pkgdown
Browse files Browse the repository at this point in the history
Update and fix the pkgdown workflow
  • Loading branch information
averissimo committed Jun 16, 2023
2 parents d7a36c5 + 10a7c6e commit 872533c
Showing 1 changed file with 26 additions and 39 deletions.
65 changes: 26 additions & 39 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,36 @@
name: pkgdown
on:
push:
branches:
- main
- master

name: pkgdown

branches: [main]
workflow_dispatch:
permissions:
contents: write
jobs:
pkgdown:
runs-on: macOS-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
main:
name: Build and publish website
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Checkout repository
uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v1

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

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}
- name: Install R
uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true # Dramatically speeds up installation of dependencies.

- name: Cache R packages
uses: actions/cache@v2
- name: Install R package dependencies
uses: r-lib/actions/setup-r-dependencies@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
extra-packages: any::pkgdown, local::.

- name: Install dependencies
- name: Configure git
run: |
remotes::install_github("Appsilon/shiny.react")
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install package
run: R CMD INSTALL .

- name: Deploy package
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
- name: Build and deploy site
shell: Rscript {0}
run: pkgdown::deploy_to_branch()
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 872533c

Please sign in to comment.