diff --git a/.github/workflows/merge.yaml b/.github/workflows/merge.yaml index 8d8ac97..4ddfb21 100644 --- a/.github/workflows/merge.yaml +++ b/.github/workflows/merge.yaml @@ -23,9 +23,6 @@ jobs: contents: write steps: - uses: actions/checkout@v3 - with: - ref: ${{ github.event.pull_request.merge_commit_sha }} - fetch-depth: '0' - name: Set up JDK 21 uses: actions/setup-java@v3 @@ -40,8 +37,30 @@ jobs: - name: Update dependency graph uses: advanced-security/maven-dependency-submission-action@571e99aab1055c2e71a1e2309b9691de18d6b7d6 - - name: Bump version and push tag - uses: anothrNick/github-tag-action@1.64.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # if you don't want to set write permissions use a PAT token - WITH_V: true + - name: Bump SemVer tag + id: semver + uses: mathieudutour/github-tag-action@v5 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + release_only: false + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64/v8 + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.semver.outputs.new_tag }} diff --git a/.github/workflows/push-image.yaml b/.github/workflows/push-image.yaml deleted file mode 100644 index bde2541..0000000 --- a/.github/workflows/push-image.yaml +++ /dev/null @@ -1,50 +0,0 @@ - -name: "[Docker] Build & Publish image" -on: - push: - tags: - - 'v*' - -jobs: - docker: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Docker meta - id: meta - uses: docker/metadata-action@v5 - with: - images: | - vispana/vispana - docker.io/vispana/vispana - tags: | - type=ref,event=branch - type=ref,event=pr - type=semver,pattern={{version}} - type=semver,pattern={{major}}.{{minor}} - flavor: | - latest=true - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Login to Docker Hub - if: github.event_name != 'pull_request' - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64/v8 - push: ${{ github.event_name != 'pull_request' }} - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }}