|
| 1 | +# Workflow derived from https://github.com/r-lib/actions/tree/master/examples |
| 2 | +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help |
1 | 3 | on: |
2 | 4 | push: |
3 | | - branches: |
4 | | - - main |
5 | | - - master |
6 | | - tags: |
7 | | - -'*' |
| 5 | + branches: [main, master] |
| 6 | + release: |
| 7 | + types: [published] |
| 8 | + workflow_dispatch: |
8 | 9 |
|
9 | 10 | name: pkgdown |
10 | 11 |
|
11 | 12 | jobs: |
12 | 13 | pkgdown: |
13 | | - runs-on: macOS-latest |
| 14 | + runs-on: ubuntu-latest |
14 | 15 | env: |
15 | 16 | GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
16 | 17 | steps: |
17 | 18 | - uses: actions/checkout@v2 |
18 | | - - uses: r-lib/actions/setup-r@v1 |
19 | | - - uses: r-lib/actions/setup-tinytex@v1 |
20 | 19 | - uses: r-lib/actions/setup-pandoc@v1 |
21 | | - |
22 | | - - name: Query dependencies |
23 | | - run: | |
24 | | - install.packages('remotes') |
25 | | - saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2) |
26 | | - writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version") |
27 | | - shell: Rscript {0} |
28 | | - |
29 | | - - name: Restore R package cache |
30 | | - uses: actions/cache@v2 |
| 20 | + - uses: r-lib/actions/setup-tinytex@v1 |
| 21 | + - uses: r-lib/actions/setup-r@v1 |
31 | 22 | with: |
32 | | - path: ${{ env.R_LIBS_USER }} |
33 | | - key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }} |
34 | | - restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1- |
| 23 | + use-public-rspm: true |
35 | 24 |
|
36 | | - - name: Install dependencies |
37 | | - run: | |
38 | | - install.packages("pkgdown", type = "binary") |
39 | | - install.packages("pdftools", type = "binary") |
40 | | - remotes::install_deps(dependencies = TRUE) |
41 | | - shell: Rscript {0} |
42 | | - |
43 | | - - name: Install package |
44 | | - run: R CMD INSTALL . |
| 25 | + - uses: r-lib/actions/setup-r-dependencies@v1 |
| 26 | + with: |
| 27 | + extra-packages: [pkgdown, pdftools] |
| 28 | + needs: website |
45 | 29 |
|
46 | 30 | - name: Deploy package |
47 | 31 | run: | |
48 | | - git config --local user.email "[email protected]" |
49 | | - git config --local user.name "GitHub Actions" |
| 32 | + git config --local user.name "$GITHUB_ACTOR" |
| 33 | + git config --local user.email "[email protected]" |
50 | 34 | Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)' |
0 commit comments