Skip to content

Commit

Permalink
Merge pull request #24 from Trails-Through-Shadows/workflow
Browse files Browse the repository at this point in the history
Created workflow for test and deploy
  • Loading branch information
Firestone82 authored Jan 26, 2024
2 parents 40fd38f + d4e5b11 commit 40b517a
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
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

- 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

0 comments on commit 40b517a

Please sign in to comment.