-
Notifications
You must be signed in to change notification settings - Fork 18
50 lines (44 loc) · 1.72 KB
/
cd.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
49
50
name: DeployAWS
on:
push:
branches: [develop]
pull_request:
branches: [develop]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup node
uses: actions/setup-node@v4
with:
node-version: 20.8
- name: install dependencies
run: yarn install
- name: build projects
run: yarn build
- uses: shinyinc/[email protected]
- name: sync static with s3
run: aws s3 sync apps/static ${{ format('s3://{0}', secrets.AWS_S3_BUCKET_NAME_HOM) }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
- name: sync react with s3
run: aws s3 sync apps/react/dist ${{ format('s3://{0}/react', secrets.AWS_S3_BUCKET_NAME_HOM) }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
- name: sync container with s3
run: aws s3 sync apps/container/dist ${{ format('s3://{0}/app', secrets.AWS_S3_BUCKET_NAME_HOM) }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1
- name: invalidate cloudfront cache
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.AWS_DISTRIBUTION_ID_HOM }} --paths "/*"
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: us-east-1