-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (38 loc) · 1.09 KB
/
nginx-server-cd.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
name: Blue-Green Backend Production Deploy (CD)
on:
workflow_dispatch:
jobs:
deploy:
name: Deploy Backend Production Server
runs-on: shook-nginx-runner
steps:
- name: Checkout Source Code
uses: actions/checkout@v2
with:
token: ${{ secrets.SUBMODULE_PAT }}
submodules: recursive
- name: Grant execute permission to gradlew
shell: bash
run: chmod +x backend/gradlew
- name: Check Java Version
shell: bash
run: java --version
- name: Gradlew bootJar
shell: bash
run: |
cd backend
./gradlew bootJar
- name: Copy Jar
shell: bash
run: cp backend/build/libs/shook-0.0.1-SNAPSHOT.jar /home/ubuntu/application-jar
- name: Backend Deploy
shell: bash
run: bash /home/ubuntu/blue-green.sh
switch-server:
name: Switch Backend Production Server
runs-on: shook-prod
needs: deploy
steps:
- name: Run switch_server.sh
shell: bash
run: bash /home/ubuntu/blue-green/server_switch.sh