-
Notifications
You must be signed in to change notification settings - Fork 6
48 lines (41 loc) · 1.63 KB
/
main.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-to-42ByteClientS3
on:
push:
branches: [deploy]
jobs:
build:
runs-on: ubuntu-18.04
steps:
- name: git clone
uses: actions/checkout@v2
- name: npm install for eslint
run: npm install
- name: npm install
run: npm install
working-directory: ./client
- name: build
env:
REACT_APP_ACCESS_ID: ${{ secrets.REACT_APP_ACCESS_ID }}
REACT_APP_ACCESS_KEY: ${{ secrets.REACT_APP_ACCESS_KEY }}
REACT_APP_BUCKET_NAME: ${{ secrets.REACT_APP_BUCKET_NAME }}
REACT_APP_REGION: ${{ secrets.REACT_APP_REGION }}
REACT_APP_SERVERIP: ${{ secrets.REACT_APP_SERVERIP }}
run: CI='' npm run build
working-directory: ./client
- name: Transfer to S3 for serving static
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_IAM_MANAGER_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_IAM_MANAGER_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_BUCKET_REGION }}
SOURCE_DIR: '/home/runner/work/42byte/42byte/client/build'
- name: 캐시 무효화
env:
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_IAM_MANAGER_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_IAM_MANAGER_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_BUCKET_REGION }}
run: aws cloudfront create-invalidation --distribution-id=E12HWSI28LDLX4 --paths "/*"