1
+ name : Deploy Serverless SSR (Dev)
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - develop
7
+
8
+ jobs :
9
+ deploy :
10
+ name : deploy
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - uses : actions/checkout@master
14
+ - name : Get yarn cache
15
+ id : yarn-cache
16
+ run : echo "::set-output name=dir::$(yarn cache dir)"
17
+
18
+ - uses : actions/cache@v1
19
+ with :
20
+ path : ${{ steps.yarn-cache.outputs.dir }}
21
+ key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
22
+ restore-keys : |
23
+ ${{ runner.os }}-yarn-
24
+ - name : yarn install
25
+
26
+ with :
27
+ cmd : install
28
+ - name : npm run build:ci
29
+ run : npm run build:ci
30
+ env :
31
+ REACT_APP_API_HOST : ' https://v2dev.velog.io/'
32
+ PUBLIC_URL : ' https://d3v0gm8v6v8olv.cloudfront.net/'
33
+ STAGE : true
34
+ - name : s3 sync
35
+ uses : jakejarvis/s3-sync-action@master
36
+ with :
37
+ args : --follow-symlinks --delete
38
+ env :
39
+ AWS_S3_BUCKET : ${{ secrets.AWS_S3_BUCKET_DEV }}
40
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
41
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_KEY }}
42
+ AWS_REGION : ' ap-northeast-2'
43
+ SOURCE_DIR : ' build'
44
+
45
+ - name : serverless deploy
46
+ uses : serverless/github-action@master
47
+ with :
48
+ args : deploy --stage production
49
+ env :
50
+ # or if using AWS creds directly
51
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
52
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_KEY }}
53
+ REACT_APP_API_HOST : ' https://v2dev.velog.io/'
54
+ PUBLIC_URL : ' https://d3v0gm8v6v8olv.cloudfront.net/'
55
+ STAGE : true
56
+ - name : Deploy Completion Webhook
57
+ uses : joelwmale/webhook-action@master
58
+ env :
59
+ WEBHOOK_URL : ${{ secrets.SSR_COMPLETE_WEBHOOK }}
60
+ data : " {'deployment': 'finished'}"
61
+ - name : Slack Notification
62
+
63
+ env :
64
+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK }}
65
+ SLACK_USERNAME : ' Github Actions'
66
+ SLACK_ICON : ' https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'
67
+ SLACK_MESSAGE : ' 벨로그 웹 클라이언트 배포가 끝났어요! :rocket:'
0 commit comments