Skip to content

Commit 6108d16

Browse files
authored
Merge pull request #74 from ChooseTale/feat/atc/CD
fix: 슬랙 로직 추가
2 parents 904bb21 + 8df21ba commit 6108d16

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

.github/workflows/auto-cd(dev).yaml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ env:
1818
SERVER_SSH_PASSPHRASE: ${{ secrets.DEV_SERVER_SSH_PASSPHRASE }}
1919
DEPLOY_PATH: choose-tale/Backend
2020
BRANCH: ${{github.ref_name}}
21-
PORT: IF [ "${{ inputs.dev_command }}" = "yarn dev:test" ]; then 6001; else 5001; fi
2221

2322
jobs:
2423
deploy:
@@ -61,8 +60,17 @@ jobs:
6160
sleep 5
6261
EOF
6362
64-
- name: 원격 서버에 배포 완료
63+
- name: 슬랙 메시지 전송
64+
env:
65+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_CHANNEL_WEBHOOK }}
6566
run: |
67+
if [ "${{ inputs.dev_command }}" = "yarn dev:test" ]; then
68+
PORT=6001
69+
elif [ "${{ inputs.dev_command }}" = "yarn dev" ]; then
70+
PORT=5001
71+
else
72+
PORT="알 수 없음"
73+
fi
6674
curl -X POST -H 'Content-type: application/json' --data '{"text":"배포가 완료되었습니다. port: ${{ env.PORT }} , branch: ${{ env.BRANCH }}"}' $SLACK_WEBHOOK_URL
6775
6876
- name: SSH 키 정리

.github/workflows/update_swagger.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,5 @@ jobs:
5959
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_CI_CHANNEL_WEBHOOK }}
6060
SWAGGER_HUB_URI: ${{ secrets.SWAGGER_HUB_URI }}
6161
run: |
62+
6263
curl -X POST -H 'Content-type: application/json' --data '{"text":"Swagger updated: '"$SWAGGER_HUB_URI/$SWAGGER_VERSION"'"}' $SLACK_WEBHOOK_URL

0 commit comments

Comments
 (0)