diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 55dd051..f796000 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,22 +27,24 @@ jobs: - name: Build with Maven run: mvn -B clean package - - name: Debug jar output - run: | - echo "Listing target directory:" - ls -la target + - name: Copy jar to server (no tar) + uses: appleboy/scp-action@v0.1.7 + with: + host: ${{ secrets.SERVER_IP }} + username: ${{ secrets.SERVER_USER }} + key: ${{ secrets.SERVER_SSH_KEY }} + source: "target/troostwijk-scraper-1.0-SNAPSHOT-jar-with-dependencies.jar" + target: "/opt/auction/app.jar" + overwrite: true + tar: false + timeout: 600 - - name: Deploy JAR via native SCP + - name: Restart service uses: appleboy/ssh-action@v0.1.7 with: host: ${{ secrets.SERVER_IP }} username: ${{ secrets.SERVER_USER }} key: ${{ secrets.SERVER_SSH_KEY }} script: | - echo "Copying JAR to server..." - scp -o StrictHostKeyChecking=no target/*.jar ${{ secrets.SERVER_USER }}@${{ secrets.SERVER_IP }}:/opt/auction/app_new.jar - echo "Replacing live JAR..." - mv /opt/auction/app_new.jar /opt/auction/app.jar - echo "Restarting service..." systemctl restart auction echo "Deploy complete"