diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 09fa125d..21c988f5 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -67,6 +67,7 @@ jobs: cp "VelocityCore/Dependencies/build/libs/Dependencies-all.jar" "deploy/DependenciesVelocityCore.jar" cp "VelocityCore/build/libs/VelocityCore-all.jar" "deploy/VelocityCore.jar" cp "WebsiteBackend/build/libs/WebsiteBackend-all.jar" "deploy/website-api.jar" + cp "CLI/build/distributions/sw.zip" "deploy/sw.zip" - name: Upload deploy artifacts uses: actions/upload-artifact@v3 @@ -130,3 +131,15 @@ jobs: ssh -i ~/.ssh/deploy_key -p "$port" "${DEPLOY_USER}@${DEPLOY_HOST}" "mkdir -p '$DEPLOY_PATH'" scp -i ~/.ssh/deploy_key -P "$port" deploy/* "${DEPLOY_USER}@${DEPLOY_HOST}:$DEPLOY_PATH/" + - name: Restart Services + shell: bash + env: + DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }} + DEPLOY_USER: ${{ secrets.DEPLOY_USER }} + DEPLOY_PORT: ${{ secrets.DEPLOY_PORT }} + DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }} + run: | + set -euo pipefail + + ssh -i ~/.ssh/deploy_key -p "$DEPLOY_PORT" "${DEPLOY_USER}@${DEPLOY_HOST}" "sudo systemctl restart api.service" + ssh -i ~/.ssh/deploy_key -p "$DEPLOY_PORT" "${DEPLOY_USER}@${DEPLOY_HOST}" "unzip -o /jars/current/sw.zip -d /jars"