Fixed java version in workflow #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
service tts-api restart |