-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (45 loc) · 1.29 KB
/
dev-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
45
46
47
48
49
50
51
name: dev-CD
on:
push:
branches: [ develop ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
token: ${{secrets.SUBMODULE_ACCESS_KEY}}
- name: Build App
run: ./gradlew bootJar
- name: Deploy Dev use SCP
uses: appleboy/scp-action@master
with:
username: ubuntu
host: ${{ secrets.DEV_HOST }}
key: ${{ secrets.PRIVATE_KEY }}
source: "./build/libs/*.jar"
target: "/home/ubuntu/deploy"
strip_components: 2
- name: Transfer Deploy Script use SCP
uses: appleboy/scp-action@master
with:
username: ubuntu
host: ${{ secrets.DEV_HOST }}
key: ${{ secrets.PRIVATE_KEY }}
source: "deploy/dev-deploy.sh"
target: "/home/ubuntu/deploy"
strip_components: 1
- name: Execute Server Init Script
uses: appleboy/ssh-action@master
with:
username: ubuntu
host: ${{ secrets.DEV_HOST }}
key: ${{ secrets.PRIVATE_KEY }}
script_stop: true
script: |
cd /home/ubuntu/deploy
chmod u+x dev-deploy.sh
./dev-deploy.sh