-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) Β· 1.66 KB
/
deploy.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
name: CI/CD
# 'boilerPlate' λΈλμΉμ νΈμλ λ μν¬νλ‘μ°λ₯Ό μ€ν
on:
push:
branches:
- boilerPlate
# μμ
μ μ
jobs:
build:
# μ΄ μμ
μ μ°λΆν¬ μ΅μ λ²μ μμ μ€ν
runs-on: ubuntu-latest
steps:
# 1λ¨κ³: λ ν¬μ§ν 리 μ½λ 체ν¬μμ
- name: Checkout source code
uses: actions/checkout@v2
# 2λ¨κ³: μ°λΆν¬ λ²μ μ νμΈ (μ ν)
- name: Check Ubuntu version
run: lsb_release -a
# 3λ¨κ³: νκ²½ λ³μ νμΌ μμ±
- name: Create env file
run: |
touch .env
echo REACT_APP_API_URL=${{ secrets.REACT_APP_API_URL }} >> .env
echo REACT_APP_KAKAO_REST_API=${{ secrets.REACT_APP_KAKAO_REST_API }} >> .env
echo REACT_APP_KAKAO_REDIRECT_URI=${{ secrets.REACT_APP_KAKAO_REDIRECT_URI }} >> .env
cat .env
# 4λ¨κ³: νλ‘μ νΈ μμ‘΄μ±μ μ€μΉ
- name: Install dependencies
run: npm install
# 5λ¨κ³: νλ‘μ νΈλ₯Ό λΉλ
- name: Build
run: npm run build
# 6λ¨κ³: AWS CLI λ²μ νμ(μ ν)
- name: SHOW AWS CLI VERSION
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws --version
# 7λ¨κ³: λΉλ νμΌμ S3 λ²ν·μ λκΈ°ν.
- name: Sync Bucket
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 sync \
--region ap-northeast-2 \
build s3://petree-front\
--delete