-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (57 loc) · 2.32 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: fantorage
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v3
- name: Use Node.js version 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: yarn
cache-dependency-path: frontend/yarn.lock
- name: frontend yarn build
env:
NEXT_PUBLIC_BASE_URL: ${{secrets.NEXT_PUBLIC_BASE_URL}}
NEXT_PUBLIC_KAKAO_REDIRECT_URI: ${{secrets.NEXT_PUBLIC_KAKAO_REDIRECT_URI}}
NEXT_PUBLIC_KAKAO_REST_API_KEY: ${{secrets.NEXT_PUBLIC_KAKAO_REST_API_KEY}}
run: |
cd frontend
npm install -g yarn
yarn install --frozen-lockfile
yarn build
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Enter dir and backend deploy
uses: serverless/[email protected]
with:
args: -c "cd backend && serverless plugin install --name serverless-webpack && serverless plugin install --name serverless-dotenv-plugin && serverless deploy"
entrypoint: /bin/sh
env:
MONGOOSE_CONNECT_STRING: ${{secrets.MONGOOSE_CONNECT_STRING}}
AWS_S3_REGION: ${{secrets.AWS_S3_REGION}}
MONGO_DB_SRV: ${{secrets.MONGO_DB_SRV}}
AWS_S3_ACCESS: ${{secrets.AWS_S3_ACCESS}}
AWS_S3_SECRET: ${{secrets.AWS_S3_SECRET}}
AWS_S3_ACL: ${{secrets.AWS_S3_ACL}}
AWS_S3_POST_BUCKET: ${{secrets.AWS_S3_POST_BUCKET}}
AWS_S3_URL: ${{secrets.AWS_S3_URL}}
KAKAO_REST_API_KEY: ${{secrets.KAKAO_REST_API_KEY}}
KAKAO_CLIENT_SECRET: ${{secrets.KAKAO_CLIENT_SECRET}}
KAKAO_REDIRECT_URI: ${{secrets.KAKAO_REDIRECT_URI}}
- name: Deploy to S3
env:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 rm s3://${{secrets.AWS_BUCKET_NAME}} --recursive
aws s3 cp --recursive --region ap-northeast-2 frontend/out s3://${{secrets.AWS_BUCKET_NAME}}