-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (35 loc) · 1.08 KB
/
main-api-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
name: Deploy Main API-Server
on:
push:
branches:
- main
paths:
- "Backend/apps/api/src/**"
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: 코드 체크아웃
uses: actions/checkout@v4
- name: SSH 에이전트 설정
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.API_SERVER_SSH }}
- name: 서버 배포
id: deploy
continue-on-error: true
run: |
set -o pipefail
ssh -o StrictHostKeyChecking=no ${{ secrets.API_USER_NAME }}@${{ secrets.API_SERVER_ADDRESS }} << 'EOF'
chmod +x /lico/Backend/server/api/deploy.sh || exit 2
/lico/Backend/server/api/deploy.sh main
EOF
ssh_exit_code=$?
echo "DEPLOY_RESULT=$ssh_exit_code" >> $GITHUB_ENV
exit "$ssh_exit_code"
- name: 결과 전송
run: |
curl -X POST -H "Content-Type: application/json" -d '{
"server": "main",
"result": "${{ env.DEPLOY_RESULT }}"
}' ${{ secrets.WEBHOOK_URL }}