forked from d13co/voi-observer
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (39 loc) · 1.19 KB
/
deploy_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
name: Publish site to S3
on:
push:
branches:
- master
workflow_dispatch:
env:
BUCKET_NAME: ${{ secrets.BUCKET_NAME }}
AWS_REGION: ${{ secrets.AWS_REGION }}
IAM_DEPLOYMENT_ROLE_ARN: ${{ secrets.IAM_DEPLOYMENT_ROLE_ARN }}
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
permissions:
id-token: write
contents: read
jobs:
S3PackageUpload:
runs-on: ubuntu-latest
steps:
- name: Git clone the repository
uses: actions/checkout@v4
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v3
with:
role-to-assume: ${{ env.IAM_DEPLOYMENT_ROLE_ARN }}
aws-region: ${{ env.AWS_REGION }}
- name: Build website
uses: actions/setup-node@v4
with:
node-version: 22
- name: Install dependencies
run: yarn
- name: Build website
run: yarn build
- name: Copy website to s3
run: |
aws s3 cp ./build s3://${{ env.BUCKET_NAME }}/ --recursive
- name: Invalidate Cloudfront distribution
run: |
aws cloudfront create-invalidation --distribution-id ${{ env.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"