Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Merge pull request #159 from Z-Jais/master #34

Merge pull request #159 from Z-Jais/master

Merge pull request #159 from Z-Jais/master #34

Workflow file for this run

name: Release
on:
push:
branches:
- stable
env:
FOLDER: /home/pi/api/
jobs:
build:
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
distribution: 'adopt'
- name: Build
run: mvn clean package
- name: Install SSH KEY
uses: shimataro/ssh-key-action@v2
with:
key: ${{ secrets.SSH_PRIVATE_KEY }}
known_hosts: 'just-a-placeholder-so-we-dont-get-errors'
- name: Adding Known Hosts
run: ssh-keyscan -p 2222 -H ${{ secrets.SSH_HOST_IP }} >> ~/.ssh/known_hosts
- name: SSH Commands
run: |
scp -P 2222 target/api-1.0.0-jar-with-dependencies.jar ${{ secrets.SSH_DESTINATION }}:"$FOLDER"
ssh -C -p 2222 ${{ secrets.SSH_DESTINATION }} "screen -XS API quit && cd $FOLDER && ./start.sh"