-
Notifications
You must be signed in to change notification settings - Fork 1
42 lines (33 loc) · 977 Bytes
/
demo-deploy.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
name: Deploy Demo to AWS
on:
push:
branches:
- web-demo
jobs:
deploy:
runs-on: ubuntu-latest
env:
AWS_REGION: us-east-1
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install dependencies
run: npm ci
- name: Build React App
env:
GENERATE_SOURCEMAP: false
run: npm run build
- name: Configure AWS CLI
run: |
aws configure set aws_access_key_id ${{ secrets.AWS_ACCESS_KEY_ID }}
aws configure set aws_secret_access_key ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws configure set default.region $AWS_REGION
- name: Deploy to S3
run: |
aws s3 sync build/ s3://dialogcraft --delete --acl public-read
- name: Invalidate CloudFront cache
run: aws cloudfront create-invalidation --distribution-id E131KHFX460NXK --paths "/*"