-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (81 loc) · 2.91 KB
/
deploy.yml
File metadata and controls
103 lines (81 loc) · 2.91 KB
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# This workflow will do a clean install of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: deploy
on:
push:
branches:
- develop
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
node-version: [22.13.0]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout source code.
uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Check Npm -v
run: npm -v
- name: Debug secrets.ENV
run: |
if [[ -z "${{ secrets.ENV }}" ]]; then
echo "ERROR: secrets.ENV is empty!"
exit 1
else
echo "secrets.ENV is set but value is hidden for security reasons.."
fi
- name: create env file
working-directory: ./
run: |
pwd
touch .env
echo ENV=${{ secrets.ENV }} > .env
cat .env
# - name: create env file
# working-directory: ./
# run: |
# pwd
# touch .env
# echo "ENV=test_value" > .env
# cat .env
# - name: Verify .env file size
# run: |
# if [ ! -s .env ]; then
# echo ".env file is empty or does not exist."
# exit 1
# else
# echo ".env file created successfully:"
# cat .env
# fi
- name: build server files
working-directory: ./
run: |
pwd
yarn
yarn run build
###################################### 추가된 부분 ######################################
- name: zip file
run: zip -r artne.zip ./scripts ./appspec.yml ./.env ./package.json index.js ./config ./src ./middlewares
- name: Verify zip file contents
run: |
unzip -l artne.zip
unzip -p artne.zip .env
- name: AWS configure credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: upload to S3
run: aws s3 cp --region ap-northeast-2 ./artne.zip s3://artne-build/deploy/
- name: deploy with AWS codeDeploy
run: aws deploy create-deployment
--application-name artne-codedeploy
--deployment-config-name CodeDeployDefault.OneAtATime
--deployment-group-name GROUP
--s3-location bucket=artne-build,bundleType=zip,key=deploy/artne.zip