diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 6fb00c6..e031a8a 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -28,8 +28,18 @@ jobs: - name: Check Java version run: java -version - - name: Upload artifact for Docker job + - name: Build with Maven run: ./mvnw package + - name: Publish to GitHub Packages Apache Maven + run: mvn deploy + env: + GITHUB_TOKEN: ${{ github.token }} + - name: Upload artifact for Docker job + uses: actions/upload-artifact@v3 + with: + name: java-app + path: '${{ github.workspace }}/target/*.jar' + docker: @@ -41,6 +51,10 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Download artifact from Maven job + uses: actions/download-artifact@v3 + with: + name: java-app - name: Logging in to Docker run: docker login ghcr.io -u shatvani -p ${{ github.token }} - name: Build the Docker image