From 8b33bf40c3dfb9b9d80d3e978e54046b7135d8f9 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Fri, 15 May 2026 15:51:01 +0200 Subject: [PATCH] Add CLI artifact deployment and service restart steps in build workflow Signed-off-by: Chaoscaot --- .gitea/workflows/build.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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"