-
Notifications
You must be signed in to change notification settings - Fork 2
82 lines (72 loc) · 2.2 KB
/
be-cd-prod.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
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
name: BE CD for Prod
on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
- backend/**
jobs:
build:
uses: ./.github/workflows/build.yml
with:
profile: prod
secrets:
secret_yml: ${{ secrets.PROD_SECRET_YML }}
deploy:
needs: [ build ]
uses: ./.github/workflows/blue-green.yml
with:
self_hosted_runner: prod
artifact_name: ${{ needs.build.outputs.artifact_name }}
jar_name: ${{ needs.build.outputs.jar_name }}
profile: prod
app_path: ~/app
rollback:
name: "[Failure] Rollback Deploy"
needs: deploy
if: failure() && needs.deploy.result == 'failure'
uses: ./.github/workflows/shutdown.yml
with:
self_hosted_runner: prod
port: ${{ needs.deploy.outputs.green_port }}
deploy-failure-notification:
name: "[Failure] Deploy Failure Notification"
needs: deploy
if: failure() && needs.deploy.result == 'failure'
runs-on: ubuntu-latest
steps:
- name: Send notification to Discord # todo
run: echo "테스트입니다"
configure-nginx:
needs: deploy
uses: ./.github/workflows/nginx-port-forwarding.yml
with:
self_hosted_runner: prod
app_path: ~/app
old_port: ${{ needs.deploy.outputs.blue_port }}
new_port: ${{ needs.deploy.outputs.green_port }}
rollback-nginx:
name: "[Failure] Rollback Nginx"
needs: configure-nginx
if: failure() && (needs.configure-nginx.result == 'failure')
uses: ./.github/workflows/nginx-port-forwarding.yml
with:
self_hosted_runner: prod
app_path: ~/app
old_port: ${{ needs.configure-nginx.outputs.new_port }}
new_port: ${{ needs.configure-nginx.outputs.old_port }}
old_shutdown: true
configure-nginx-faliure-notification:
name: "[Failure] Nginx Failure Notification"
needs: configure-nginx
if: failure() && needs.configure-nginx.result == 'failure'
runs-on: ubuntu-latest
steps:
- name: Send notification to Discord # todo
run: echo "테스트입니다"
blue-shutdown:
needs: configure-nginx
uses: ./.github/workflows/shutdown.yml
with:
self_hosted_runner: prod
port: ${{ needs.configure-nginx.outputs.old_port }}