Skip to content

Commit

Permalink
ci: Update and fix the pkgdown workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilzyla committed Jun 15, 2023
1 parent d6381bc commit d554b58
Showing 1 changed file with 31 additions and 42 deletions.
73 changes: 31 additions & 42 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,49 +1,38 @@
on:
push:
branches:
- main
- master

name: pkgdown

on: push
# on:
# push:
# 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: 60
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- name: Checkout repository
uses: actions/checkout@v3

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

- 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

- 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-

- name: Install dependencies
run: |
remotes::install_github("Appsilon/shiny.react")
remotes::install_deps(dependencies = TRUE)
install.packages("pkgdown", type = "binary")
shell: Rscript {0}

- 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)'
extra-packages: any::pkgdown, local::.

# - name: Configure git
# run: |
# git config user.name "$GITHUB_ACTOR"
# git config user.email "[email protected]"

# - name: Build and deploy site
# shell: Rscript {0}
# run: pkgdown::deploy_to_branch(branch = "test/gh-pages")
# env:
# GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d554b58

Please sign in to comment.