diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ef2e8ec..5a06521 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,25 +10,24 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 - name: Install Maven run: | - apt-get update - apt-get install -y maven + apt update + apt install -y maven - name: Set up Java 17 uses: actions/setup-java@v4 with: distribution: temurin java-version: 17 - cache: maven - name: Build with Maven run: mvn -B clean package - - name: Copy jar to server + - name: Copy jar to server (direct) uses: appleboy/scp-action@v0.1.7 with: host: ${{ secrets.SERVER_IP }} @@ -36,12 +35,15 @@ jobs: key: ${{ secrets.SERVER_SSH_KEY }} source: "target/*.jar" target: "/opt/auction/" + tar_ignore: true + overwrite: true - - name: Restart service + - name: Rename jar + restart uses: appleboy/ssh-action@v0.1.7 with: host: ${{ secrets.SERVER_IP }} username: ${{ secrets.SERVER_USER }} key: ${{ secrets.SERVER_SSH_KEY }} script: | + mv /opt/auction/*.jar /opt/auction/app.jar sudo systemctl restart auction