-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (48 loc) · 1.43 KB
/
build-and-deploy.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
name: Build and Deploy RMarkdown Website
on:
workflow_dispatch:
push:
branches: main
pull_request:
branches: main
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v1
- uses: r-lib/actions/setup-r@v1
with:
install-r: false
use-public-rspm: true
- name: Install R system requirements
run: |
sudo apt-get update
sudo apt-get install libcurl4-openssl-dev
- name: Install R dependencies
run: |
install.packages(c("remotes", "rmarkdown"))
remotes::install_deps(dependencies = TRUE)
shell: Rscript {0}
- name: Render Site
run: Rscript -e "rmarkdown::render_site(encoding = 'UTF-8')"
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./_site
# Deployment job
deploy:
if: github.event_name != 'pull_request'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1