-
Notifications
You must be signed in to change notification settings - Fork 27
57 lines (55 loc) · 2.04 KB
/
site.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
name: Site
on:
push:
paths:
- site/**
- .github/workflows/site.yaml
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Deploy Prepare
run: |
echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
echo "DEPLOY_URL=" >> $GITHUB_ENV
- name: Deploy Commit
run: |
echo "SHORT_SHA=${SHORT_SHA}"
echo "DEPLOY_URL=commits/${SHORT_SHA}/" >> $GITHUB_ENV
if: github.ref != 'refs/heads/main'
- name: Deploy URL
run: echo "DEPLOY_URL=${DEPLOY_URL}"
- uses: quarto-dev/quarto-actions/setup@v2
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-pandoc@v2
- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
- name: Install Quarto Deps
run: |
Rscript -e 'install.packages(c("rmarkdown", "reticulate"))'
working-directory: ./r
- name: Render quarto
run: quarto render
working-directory: ./site
- name: Add Commit SHA
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-8`" >> $GITHUB_ENV
- uses: zdurham/s3-upload-github-action@master
with:
args: --recursive --acl public-read
env:
FILE: './site/_site'
AWS_REGION: 'us-west-2'
S3_BUCKET: 'notebooks.hal9.com'
S3_KEY: ${{ env.DEPLOY_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- uses: LouisBrunner/checks-action@v1.1.1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: preview
conclusion: ${{ job.status }}
action_url: ${{ format('https://s3.amazonaws.com/notebooks.hal9.com/{0}index.html', env.DEPLOY_URL) }}
details_url: ${{ format('https://s3.amazonaws.com/notebooks.hal9.com/{0}index.html', env.DEPLOY_URL) }}
output: "{ \"summary\": \"${{ format('https://s3.amazonaws.com/notebooks.hal9.com/{0}index.html', env.DEPLOY_URL) }}\" }"