-
Notifications
You must be signed in to change notification settings - Fork 9
48 lines (38 loc) · 1.17 KB
/
pages.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
name: Deploy Web Pages
on:
push:
branches:
- "main"
jobs:
deploy:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Enable corepack
run: corepack enable
- name: Install dependency
run: yarn
- name: Browserslist update
run: npx [email protected] --update-db
- name: Build static webpages
run: yarn build
- name: Set AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_S3_REGION }}
- name: Deploy to S3
run: |
aws s3 sync --delete ./build/ s3://${{ secrets.AWS_S3_BUCKET_NAME }}/
- name: Flush cdn
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.DISTRIBUTION_ID }} --paths '/*'