-
Notifications
You must be signed in to change notification settings - Fork 0
40 lines (36 loc) · 1.15 KB
/
deploy-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
name: deploy-prod
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v1
with:
java-version: '17'
distribution: 'temurin'
- uses: atomicjar/testcontainers-cloud-setup-action@v1
with:
token: ${{ secrets.TC_CLOUD_TOKEN }}
- run: chmod +x ./gradlew
- run: ./gradlew build
- uses: appleboy/[email protected]
with:
host: ${{ secrets.QBOX_PROD_HOST }}
username: ${{ secrets.QBOX_PROD_USER }}
password: ${{ secrets.QBOX_PROD_PASSWORD}}
source: "build/libs/qbox-server-0.0.1-SNAPSHOT.jar"
target: "server/"
- uses: appleboy/ssh-action@master
with:
host: ${{ secrets.QBOX_PROD_HOST }}
username: ${{ secrets.QBOX_PROD_USER }}
password: ${{ secrets.QBOX_PROD_PASSWORD }}
script: |
cd server/build/libs
sudo kill -9 $(sudo lsof -t -i:8080)
nohup java -jar qbox-server-0.0.1-SNAPSHOT.jar > nohup.out 2> nohup.err < /dev/null &
sudo service nginx restart