-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (43 loc) · 1.11 KB
/
java.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
name: Java Deployment
on:
push:
branches:
- 'master'
- 'development'
pull_request:
branches:
- 'master'
- 'development'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK 21 maven
uses: actions/setup-java@v2
with:
java-version: 21
distribution: 'adopt'
- name: Build with Maven
run: mvn -B clean package --file pom.xml
deploy:
runs-on: ubuntu-latest
needs: [ build ]
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Execute SSH Commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: root
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: 22
script_stop: true
script: |
cd /srv/tts-game/TTS-API
eval $(keychain --eval ../.ssh/api-key)
git pull origin master
mvn -B clean package --file pom.xml
service tts-api restart