Skip to content

Commit 219a305

Browse files
committed
Update pkgdown.yaml
1 parent 0f49a3d commit 219a305

1 file changed

Lines changed: 27 additions & 42 deletions

File tree

.github/workflows/pkgdown.yaml

Lines changed: 27 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,58 +2,43 @@ name: pkgdown
22

33
on:
44
push:
5-
branches: main
5+
branches: [main]
6+
release:
7+
types: [published]
8+
workflow_dispatch:
69

710
jobs:
811
pkgdown:
9-
runs-on: ubuntu-latest # Changed to ubuntu
10-
12+
runs-on: ubuntu-latest
13+
concurrency:
14+
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}
1115
env:
1216
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
13-
R_VERSION: '4.3.2'
17+
permissions:
18+
contents: write
1419

1520
steps:
16-
- uses: actions/checkout@v4 # Updated to v4
21+
- uses: actions/checkout@v4
22+
23+
- uses: r-lib/actions/setup-pandoc@v2
1724

18-
- name: Setup R
19-
uses: r-lib/actions/setup-r@v2
25+
- uses: r-lib/actions/setup-r@v2
2026
with:
21-
r-version: ${{ env.R_VERSION }}
22-
use-public-rspm: true # Use RStudio Package Manager for better reliability
23-
24-
- name: Setup pandoc
25-
uses: r-lib/actions/setup-pandoc@v2
26-
27-
- name: Install system dependencies
28-
run: |
29-
sudo apt-get update
30-
sudo apt-get install -y libcurl4-openssl-dev libharfbuzz-dev libfribidi-dev libudunits2-dev libgdal-dev libgeos-dev libproj-dev libtiff5-dev libicu-dev libjpeg-dev
31-
32-
- name: Query dependencies
33-
run: |
34-
install.packages(c('remotes', 'here'))
35-
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
36-
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
37-
shell: Rscript {0}
27+
use-public-rspm: true
3828

39-
- name: Cache R packages
40-
uses: actions/cache@v4
29+
- uses: r-lib/actions/setup-r-dependencies@v2
4130
with:
42-
path: ${{ env.R_LIBS_USER }}
43-
key: ${{ runner.os }}-${{ env.R_VERSION }}-1-${{ hashFiles('.github/depends.Rds') }}
44-
restore-keys: ${{ runner.os }}-${{ env.R_VERSION }}-1-
45-
46-
- name: Install dependencies
47-
run: |
48-
remotes::install_deps(dependencies = TRUE)
49-
install.packages("pkgdown") # Removed "type = binary" as we're on Ubuntu
50-
shell: Rscript {0}
31+
extra-packages: any::pkgdown, local::.
32+
needs: website
5133

52-
- name: Install package
53-
run: R CMD INSTALL .
34+
- name: Build site
35+
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
36+
shell: Rscript {0}
5437

55-
- name: Deploy package
56-
run: |
57-
git config --local user.email "actions@github.com"
58-
git config --local user.name "GitHub Actions"
59-
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
38+
- name: Deploy to GitHub pages
39+
if: github.event_name != 'pull_request'
40+
uses: JamesIves/github-pages-deploy-action@v4
41+
with:
42+
clean: false
43+
branch: gh-pages
44+
folder: docs

0 commit comments

Comments
 (0)