diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml new file mode 100644 index 0000000..60b7d13 --- /dev/null +++ b/.gitea/workflows/deploy.yaml @@ -0,0 +1,34 @@ +name: Build and Deploy Java Project + +on: + push: + branches: + - master + +jobs: + build-and-deploy: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + java-version: '21' + distribution: 'temurin' + cache: 'maven' + + - name: Build and Package with Maven + run: mvn clean package -DskipTests + + - name: Deploy JAR to Server + uses: appleboy/scp-action@master + with: + host: ${{ secrets.SERVER_IP }} + username: ${{ secrets.SERVER_USERNAME }} + password: ${{ secrets.SERVER_PASSWORD }} + source: "target/*-jar-with-dependencies.jar" + target: "/opt/notifier/notifier.jar" + strip_components: 1 \ No newline at end of file diff --git a/pom.xml b/pom.xml index 7233dbf..422dc16 100644 --- a/pom.xml +++ b/pom.xml @@ -78,7 +78,7 @@ - dep + jar-with-dependencies