This commit is contained in:
2025-11-27 13:35:58 +01:00
parent 858ed6a0cf
commit 05d4a4bc63

View File

@@ -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"