Skip to content

Commit 1001c8a

Browse files
committed
Merge branch 'develop' of https://github.com/GSM-MSG/SMS-BackEnd into feature/386-teacher-grading-form
2 parents 822bab5 + 31597cc commit 1001c8a

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

.github/workflows/sms_backend_master_cd.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1+
name: sms-production-CD
2+
13
on:
24
push:
35
branches: [ "master" ]
4-
workflow_dispatch:
56

67
jobs:
7-
CD:
8-
name: CD
8+
cd:
99
runs-on: ubuntu-latest
1010
environment: production
1111

1212
steps:
1313
- name: SMS-Backend-CD Discord Notification
1414
uses: sarisia/actions-status-discord@v1
15-
if: ${{ success() }}
1615
with:
1716
title: ℹ️ SMS-Backend-CD 시작! ℹ️
1817
webhook: ${{ secrets.SMS_DISCORD_WEBHOOK }}
@@ -63,30 +62,34 @@ jobs:
6362
docker tag ${{ secrets.ECR_REPOSITORY }}:${{ secrets.IMAGE_TAG }} ${{ secrets.REPO_URL }}:${{ secrets.IMAGE_TAG }}
6463
docker push ${{ secrets.REPO_URL }}:${{ secrets.IMAGE_TAG }}
6564
66-
- name : CodeDeploy Create Deployment
67-
run: |
68-
aws deploy create-deployment \
69-
--application-name codedeploy-application \
70-
--deployment-group-name codedeploy-group \
71-
--deployment-config-name CodeDeployDefault.OneAtATime \
72-
--github-location repository=${{ github.repository }},commitId=${{ github.sha }}
65+
- name: Execute remote SSH
66+
uses: appleboy/ssh-action@master
67+
with:
68+
host: ${{ secrets.REMOTE_SSH_HOST }}
69+
username: ${{ secrets.REMOTE_SSH_USERNAME }}
70+
key: ${{ secrets.REMOTE_SSH_KEY }}
71+
port: ${{ secrets.REMOTE_SSH_PORT }}
72+
script: |
73+
aws ecr get-login-password --region ap-northeast-2 | docker login --username AWS --password-stdin ${{secrets.ECR_REPO_PATH}}
74+
docker pull ${{ secrets.REPO_URL }}:${{ secrets.IMAGE_TAG }}
75+
docker compose restart
7376
74-
- name: SMS-Backend-CD Discord Notification
77+
- name: SMS-Backend-CD Discord Notification (Success)
7578
uses: sarisia/actions-status-discord@v1
76-
if: ${{ success() }}
79+
if: success()
7780
with:
7881
title: ✅ SMS-Backend-CD 성공! ✅
7982
webhook: ${{ secrets.SMS_DISCORD_WEBHOOK }}
8083
status: ${{ job.status }}
8184
image: ${{ secrets.CD_SUCCESS_IMAGE }}
82-
description: 영역전개 CD 성공
85+
description: 프로덕션 CD 성공
8386
color: 00FF00
8487
username: SMS CD 봇
8588
url: https://github.com/GSM-MSG/SMS-BackEnd
8689

87-
- name: SMS-Backend-CD Discord Notification
90+
- name: SMS-Backend-CD Discord Notification (Failure)
8891
uses: sarisia/actions-status-discord@v1
89-
if: ${{ failure() }}
92+
if: failure()
9093
with:
9194
title: ❗️ SMS-Backend-CD 실패! ❗️
9295
webhook: ${{ secrets.SMS_DISCORD_WEBHOOK }}
@@ -95,4 +98,4 @@ jobs:
9598
description: 무례하긴, 실패다.
9699
color: FF0000
97100
username: SMS CD 봇
98-
url: https://github.com/GSM-MSG/SMS-BackEnd
101+
url: https://github.com/GSM-MSG/SMS-BackEnd

0 commit comments

Comments
 (0)