-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (68 loc) · 1.96 KB
/
website.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Website
on:
push:
branches: [main, prod]
pull_request:
branches: [main, prod]
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
container: rocker/tidyverse:4.4.1
name: rendering-${{ matrix.files.fn }}
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
strategy:
fail-fast: false
matrix:
files:
- {fn: "epiestim_vignette"}
- {fn: "EpiLPS_vignette"}
- {fn: "EpiNow2_vignette"}
- {fn: "RtEstim_vignette"}
- {fn: "eval_vignette"}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install packages
run: |
install2.r -n4 EpiLPS EpiNow2 lemon ggtext
installGithub.r EpiForeSITE/summrt
installGithub.r mrc-ide/EpiEstim
installGithub.r dajmcdon/rtestim
- name: Render the file ${{ matrix.files.fn }}
run: Rscript --vanilla -e 'rmarkdown::render("vignettes/${{ matrix.files.fn }}.Rmd", output_format = "rmarkdown::github_document")'
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.files.fn }}
path: vignettes/${{ matrix.files.fn }}*
collect:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/download-artifact@v4
with:
path: website/
- name: Upload artifacts
uses: actions/upload-pages-artifact@v3
with:
name: github-pages
path: website/
deploy:
# Deploy to the github-pages environment
# but not on PRs
if: ${{ github.event_name != 'pull_request' }}
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: collect
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
with:
artifact_name: github-pages
preview: true