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

Merge pull request #135 from Z-Jais/master #43

Merge pull request #135 from Z-Jais/master

Merge pull request #135 from Z-Jais/master #43

Workflow file for this run

name: Release
on:
push:
branches:
- stable
env:
FOLDER: /home/pi/scraper/
jobs:
build:
name: Build and release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- 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 target/scraper-1.0-SNAPSHOT-jar-with-dependencies.jar ${{ secrets.SSH_DESTINATION }}:"$FOLDER"
ssh -C ${{ secrets.SSH_DESTINATION }} "screen -XS Scraper quit && cd $FOLDER && ./start.sh"