This commit is contained in:
2025-11-28 02:08:56 +01:00
parent 7fbc9a2c96
commit a11aa41cb2
2 changed files with 6 additions and 0 deletions

50
.github/workflows/_oldbuild.nothing vendored Normal file
View File

@@ -0,0 +1,50 @@
name: Build and Deploy Auction App
on:
push:
branches:
- main
jobs:
build_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Maven
run: |
apt update
apt install -y maven
- name: Set up Java 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Build with Maven
run: mvn -B clean package
- 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/*.jar"
target: "/opt/auction/"
overwrite: true
strip_components: 1 # Strips the 'target/' directory
timeout: 60s
- 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: |
systemctl restart auction
echo "Deploy complete"