blob: 3879242ccfe883192dc9c78258b9cd78e36ba31b [file] [log] [blame]
Christophe Dervieux7f1add52021-09-15 15:42:07 +02001on:
2 push:
3 branches: [main, master]
4 tags: ['*']
5 pull_request:
6 branches: [main, master]
7name: pkgdown
8
9jobs:
10 pkgdown:
11 if: ${{ github.event_name == 'push' || startsWith(github.head_ref, 'pkgdown/') }}
12 runs-on: ubuntu-latest
13 env:
14 GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
15 steps:
16 - uses: actions/checkout@v2
17
18 - uses: r-lib/actions/setup-pandoc@v1
19
20 - uses: r-lib/actions/setup-r@v1
21 with:
22 use-public-rspm: true
23
24 - uses: r-lib/actions/setup-r-dependencies@v1
25 with:
Christophe Dervieuxb227fd02021-09-15 16:20:27 +020026 extra-packages: r-lib/pkgdown, rstudio/quillt
27 # needs: website
Christophe Dervieux7f1add52021-09-15 15:42:07 +020028
29 - name: Install package
30 run: R CMD INSTALL .
31
32 - name: Cache some pkgdown assets
33 uses: actions/cache@v2
34 with:
35 path: |
36 vignettes/articles/images/*.png
37 key: 1-${{ hashFiles('vignettes/articles/examples.yml') }}
38
39 - name: Build pkgdown site
40 run: pkgdown::build_site(new_process = FALSE)
41 shell: Rscript {0}
42
43 - name: Deploy to Netlify
christophe dervieux5f74c8a2021-09-15 15:45:25 +020044 if: ${{ false }} # TODO: setup netlify
Christophe Dervieux7f1add52021-09-15 15:42:07 +020045 id: netlify-deploy
46 uses: nwtgck/actions-netlify@v1.1
47 with:
48 publish-dir: 'reference'
49 # change back to master if branch is not correct
50 production-branch: main
51 github-token: ${{ secrets.GITHUB_TOKEN }}
52 deploy-message:
53 'Deploy from GHA: ${{ github.event.head_commit.message }} (${{ github.sha }})'
54 enable-pull-request-comment: false
55 enable-commit-comment: false
56 enable-commit-status: true
57 alias: deploy-preview-${{ github.event.number }}
58 env:
59 NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
60 NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}