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

Commit

Permalink
Merge pull request #16 from Z-Jais/master
Browse files Browse the repository at this point in the history
add stable pipeline
  • Loading branch information
Ziedelth authored Oct 20, 2022
2 parents 25e4f56 + c144a22 commit 4d15568
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
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 -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"

0 comments on commit 4d15568

Please sign in to comment.