Skip to content

Commit ba1931b

Browse files
committed
go back to macOS with pak
1 parent 6b53983 commit ba1931b

File tree

1 file changed

+21
-17
lines changed

1 file changed

+21
-17
lines changed

.github/workflows/pkgdown.yaml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,44 @@
11
on:
22
push:
33
branches:
4+
- master
45
- main
6+
pull_request:
7+
branches:
58
- master
6-
tags:
7-
-'*'
9+
- main
810

911
name: pkgdown
1012

1113
jobs:
1214
pkgdown:
13-
runs-on: ubuntu-18.04
15+
runs-on: macOS-latest
1416
env:
15-
RSPM: https://packagemanager.rstudio.com/cran/__linux__/bionic/latest
1617
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
17-
1818
steps:
1919
- uses: actions/checkout@v2
2020

2121
- uses: r-lib/actions/setup-r@v1
22-
id: install-r
2322

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

25+
- name: System dependencies
26+
run: brew install harfbuzz fribidi
27+
2628
- name: Install pak and query dependencies
2729
run: |
2830
install.packages("pak", repos = "https://r-lib.github.io/p/pak/dev/")
2931
saveRDS(pak::pkg_deps("local::.", dependencies = TRUE), ".github/r-depends.rds")
3032
shell: Rscript {0}
3133

32-
- name: Restore R package cache
34+
- name: Cache R packages
3335
uses: actions/cache@v2
3436
with:
35-
path: |
36-
${{ env.R_LIBS_USER }}/*
37-
!${{ env.R_LIBS_USER }}/pak
38-
key: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-${{ hashFiles('.github/r-depends.rds') }}
39-
restore-keys: ubuntu-18.04-${{ steps.install-r.outputs.installed-r-version }}-1-
37+
path: ${{ env.R_LIBS_USER }}
38+
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/r-depends.rds') }}
39+
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-
4040

4141
- name: Install system dependencies
42-
if: runner.os == 'Linux'
4342
run: |
4443
pak::local_system_requirements(execute = TRUE)
4544
pak::pkg_system_requirements("pkgdown", execute = TRUE)
@@ -53,7 +52,6 @@ jobs:
5352
pak::pkg_install("pkgdown")
5453
shell: Rscript {0}
5554

56-
5755
- name: Install Miniconda
5856
run: |
5957
Rscript -e "pak::pkg_install('rstudio/reticulate')"
@@ -72,8 +70,14 @@ jobs:
7270
- name: Install package
7371
run: R CMD INSTALL .
7472

75-
- name: Build and deploy pkgdown site
73+
- name: Build site
74+
if: github.ref != 'refs/heads/master'
75+
run: |
76+
Rscript -e 'pkgdown::build_site()'
77+
78+
- name: Deploy package
79+
if: github.ref == 'refs/heads/master'
7680
run: |
77-
git config --local user.name "$GITHUB_ACTOR"
78-
git config --local user.email "[email protected]"
81+
git config --local user.email "[email protected]"
82+
git config --local user.name "GitHub Actions"
7983
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'

0 commit comments

Comments
 (0)