-
Notifications
You must be signed in to change notification settings - Fork 28
44 lines (39 loc) · 1.22 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
name: website-deployment
on:
push:
branches: [ website ]
env:
CARGO_TERM_COLOR: always
concurrency: website-production
jobs:
deploy-website:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
mdBook/target
key: ${{ runner.os }}-cargo-mdBook-${{ hashFiles('mdBook/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-mdBook-
${{ runner.os }}-cargo-
- name: Copy site to S3
run: aws s3 cp src/* s3://sunscreen-site
working-directory: ./website
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2
- name: Invalidate Cloudfront
run: aws cloudfront create-invalidation --distribution-id E10NWJGCYHNFM4 --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DOCS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.DOCS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-west-2