-
Notifications
You must be signed in to change notification settings - Fork 38
35 lines (28 loc) · 1.05 KB
/
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
name: Website deployment
on:
release:
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: bin/install_dependencies.sh
- name: Run the PDF compilation process
run: bin/build.sh
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.CI_CD_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CI_CD_AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
- name: Trigger S3 deployment
run: |
aws s3 sync build s3://wca-documents/ --acl public-read
# Update version file so the website will update its cache
git_hash=$(git rev-parse --short "$GITHUB_SHA")
echo "$git_hash" > version
aws s3 cp version s3://wca-documents/version
aws cloudfront create-invalidation --distribution-id E31ELE3W069ZX7 --paths "/*" --output text