-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (51 loc) · 1.81 KB
/
build-and-deploy-vignette.yaml
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
name: Build and Deploy Vignette
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Cache apt dependencies
uses: actions/cache@v3
with:
path: /var/lib/apt/lists
key: ${{ runner.os }}-apt
restore-keys: |
${{ runner.os }}-apt
- name: Set up R
uses: r-lib/actions/setup-r@v2
- name: Cache R packages
uses: actions/cache@v3
with:
path: ~/.R/library
key: ${{ runner.os }}-r-${{ hashFiles('**/DESCRIPTION', '**/NAMESPACE') }}
restore-keys: |
${{ runner.os }}-r-
- name: Install dependencies
run: |
Rscript -e 'install.packages("devtools")'
Rscript -e 'devtools::install_deps(dependencies = TRUE)'
- name: Install the jellyfisher package
run: |
R CMD INSTALL .
- name: Build vignette
run: |
Rscript -e 'rmarkdown::render("vignettes/introduction.Rmd", output_file = "docs/introduction.html")'
echo '<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>Jellyfisher Vignettes</title></head><body><h1>Jellyfisher Vignettes</h1><ul><li><a href="docs/introduction.html">Introduction</a></li></ul></body></html>' > docs/index.html
deploy:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
publish_branch: gh-pages