-
Notifications
You must be signed in to change notification settings - Fork 2
55 lines (46 loc) · 1.52 KB
/
frontDeploy.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
51
52
53
54
55
name: Front Auto Deploy after push
on:
push:
branches:
- develop
env:
S3_BUCKET_NAME: thlee-content
AWS_REGION: ap-northeast-2
WORKING-DIRECTORY: ./src/front
jobs:
deploy:
name: Build, Deploy to S3 bucket
runs-on: [ubuntu-latest]
strategy:
matrix:
node-version: [20.11.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Npm install
run: npm install
working-directory: ${{ env.WORKING-DIRECTORY }}
- name: Build
run: npm run build
working-directory: ${{ env.WORKING-DIRECTORY }}
- 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: ${{ env.S3_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ env.AWS_REGION }}
SOURCE_DIR: "./src/front/dist"
- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@master
env:
PATHS: '/*'
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-northeast-2'
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_ID }}