File tree Expand file tree Collapse file tree 4 files changed +133
-0
lines changed Expand file tree Collapse file tree 4 files changed +133
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : SOPT Notification Development Server CD
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ branches : [ develop ]
7
+
8
+ job :
9
+ deploy :
10
+ name : Deploy to AWS Lambda
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout Code
15
+ uses : uses: actions/checkout@v3
16
+
17
+ - name : Set Node.js
18
+ uses : actions/setup-node@v3
19
+ with :
20
+ node-version : 18
21
+ cache : ' npm'
22
+
23
+ - name : Install Dependencies
24
+ run : npm ci
25
+
26
+ - name : Create Env File
27
+ env :
28
+ ENV_FILE : ${{ secrets.ENV_DEV }}
29
+ run : |
30
+ touch .env.dev
31
+ echo "$ENV_FILE" >> .env.dev
32
+
33
+ - name : Set AWS Credentials by export
34
+ env :
35
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
36
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
37
+ run : |
38
+ export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
39
+ export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}
40
+ export AWS_REGION=${{ secrets.AWS_REGION }}
41
+
42
+ - name : Deploy
43
+ run : npm run deploy:dev
44
+
Original file line number Diff line number Diff line change
1
+ name : SOPT Notification Production Server CD
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ push :
6
+ branches : [ main ]
7
+
8
+ job :
9
+ deploy :
10
+ name : Deploy to AWS Lambda
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout Code
15
+ uses : uses: actions/checkout@v3
16
+
17
+ - name : Set Node.js
18
+ uses : actions/setup-node@v3
19
+ with :
20
+ node-version : 18
21
+ cache : ' npm'
22
+
23
+ - name : Install Dependencies
24
+ run : npm ci
25
+
26
+ - name : Create Env File
27
+ env :
28
+ ENV_FILE : ${{ secrets.ENV_PROD }}
29
+ run : |
30
+ touch .env.prod
31
+ echo "$ENV_FILE" >> .env.prod
32
+
33
+ - name : Set AWS Credentials by export
34
+ env :
35
+ AWS_ACCESS_KEY_ID : ${{ secrets.AWS_ACCESS_KEY_ID }}
36
+ AWS_SECRET_ACCESS_KEY : ${{ secrets.AWS_SECRET_ACCESS_KEY }}
37
+ run : |
38
+ export AWS_ACCESS_KEY_ID=${{ secrets.AWS_ACCESS_KEY_ID }}
39
+ export AWS_SECRET_ACCESS_KEY=${{ secrets.AWS_SECRET_ACCESS_KEY }}
40
+ export AWS_REGION=${{ secrets.AWS_REGION }}
41
+
42
+ - name : Deploy
43
+ run : npm run deploy:prod
Original file line number Diff line number Diff line change
1
+ name : SOPT Notification Server CI
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ pull_request :
6
+ branches : [ develop ]
7
+
8
+ jobs :
9
+ validate :
10
+ name : Build
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout Code
15
+ uses : actions/checkout@v3
16
+
17
+ - name : Set up Node.js
18
+ uses : actions/setup-node@v3
19
+ with :
20
+ node-version : 18
21
+ cache : ' npm'
22
+
23
+ - name : Install Dependencies
24
+ run : npm ci
25
+
26
+ - name : Build Project
27
+ run : npm run build
28
+
29
+ - name : Run Serverless-offline
30
+ env :
31
+ ENV_FILE : ${{ secrets.ENV_DEV }}
32
+ run : |
33
+ touch .env.dev
34
+ echo "$ENV_FILE" >> .env.dev
35
+ nohup npm run start > nohup.out 2>&1 &
36
+
37
+ sleep 5
38
+
39
+ if grep -q "Server ready" nohup.out; then
40
+ echo "Application Run Success."
41
+ else
42
+ echo "Application Run Fail."
43
+ exit 1
44
+ fi
45
+ shell : bash
Original file line number Diff line number Diff line change 5
5
"main" : " index.js" ,
6
6
"scripts" : {
7
7
"test" : " echo \" Error: no test specified\" && exit 1" ,
8
+ "build" : " tsc --build --clean" ,
8
9
"watch" : " tsc -w" ,
9
10
"lint" : " eslint ." ,
10
11
"format" : " prettier --write ." ,
You can’t perform that action at this time.
0 commit comments