|
1 |
| -name: aphylo website |
2 |
| - |
3 |
| -on: [push, pull_request] |
| 1 | +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples |
| 2 | +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main, master] |
| 6 | + pull_request: |
| 7 | + branches: [main, master] |
| 8 | + release: |
| 9 | + types: [published] |
| 10 | + workflow_dispatch: |
4 | 11 |
|
5 |
| -env: |
6 |
| - cntr: rocker/tidyverse:latest |
| 12 | +name: aphylo website |
7 | 13 |
|
8 | 14 | jobs:
|
9 |
| - build: |
10 |
| - runs-on: Ubuntu-latest |
11 |
| - |
| 15 | + pkgdown: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + # Only restrict concurrency for non-PR jobs |
| 18 | + concurrency: |
| 19 | + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} |
| 20 | + env: |
| 21 | + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} |
| 22 | + permissions: |
| 23 | + contents: write |
12 | 24 | steps:
|
13 |
| - - uses: actions/checkout@v2 |
| 25 | + - uses: actions/checkout@v3 |
14 | 26 |
|
15 |
| - - name: Container |
16 |
| - run: docker pull ${cntr} |
| 27 | + - uses: r-lib/actions/setup-pandoc@v2 |
| 28 | + |
| 29 | + - uses: r-lib/actions/setup-r@v2 |
| 30 | + with: |
| 31 | + use-public-rspm: true |
| 32 | + |
| 33 | + - uses: r-lib/actions/setup-r-dependencies@v2 |
| 34 | + with: |
| 35 | + extra-packages: any::pkgdown, local::. |
| 36 | + needs: website |
17 | 37 |
|
18 |
| - - name: Building website |
19 |
| - run: | |
20 |
| - docker run --rm -i -v ${PWD}:/home/mnt -w /home/mnt ${cntr} \ |
21 |
| - Rscript -e 'install.packages(c("fmcmc", "ape", "Matrix", "pkgdown"));system("R CMD INSTALL .");pkgdown::build_site(install=FALSE)' |
| 38 | + - name: Build site |
| 39 | + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) |
| 40 | + shell: Rscript {0} |
22 | 41 |
|
23 |
| - - name: Deploy |
24 |
| - uses: peaceiris/actions-gh-pages@v3 |
| 42 | + - name: Deploy to GitHub pages 🚀 |
| 43 | + if: github.event_name != 'pull_request' |
| 44 | + uses: JamesIves/github-pages-deploy-action@v4.4.1 |
25 | 45 | with:
|
26 |
| - github_token: ${{ secrets.GITHUB_TOKEN }} |
27 |
| - publish_dir: ./docs |
| 46 | + clean: false |
| 47 | + branch: gh-pages |
| 48 | + folder: docs |
0 commit comments