diff --git a/.github/workflows/ci-booking.yml b/.github/workflows/ci-booking.yml index e971e3e..688780f 100644 --- a/.github/workflows/ci-booking.yml +++ b/.github/workflows/ci-booking.yml @@ -30,12 +30,11 @@ jobs: uses: actions/checkout@v4 - name: Set up JDK 21 - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '21' distribution: 'temurin' cache: 'maven' - cache-dependency-path: '${{ env.MODULE_NAME }}/pom.xml' - name: Build with Maven run: mvn -B package --file ${{ env.MODULE_NAME }}/pom.xml @@ -44,38 +43,30 @@ jobs: - name: Log in to the Container registry if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '${{ env.MODULE_NAME }}') - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ${{ env.DOCKER_REGISTRY }} username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Sanitize tag name - uses: actions/github-script@v6 + uses: actions/github-script@v7 id: sanitized_tag with: result-encoding: string script: return '${{ github.ref }}'.replace('refs/tags/', '').replace('-${{ env.MODULE_NAME }}', '').trim() - - name: Extract metadata (tags, labels) for Docker - if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '${{ env.MODULE_NAME }}') - id: meta - uses: docker/metadata-action@v4 - with: - images: ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }} - tags: | - latest - ${{ steps.sanitized_tag.outputs.result }} - - name: Build and push Docker image if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '${{ env.MODULE_NAME }}') - uses: docker/build-push-action@v4 + id: push + uses: docker/build-push-action@v5 with: context: '/home/runner/work/pt-agency/pt-agency/${{ env.MODULE_NAME }}' file: '${{ env.MODULE_NAME }}/src/main/docker/Dockerfile.jvm' push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: | + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:latest + ${{ env.DOCKER_REGISTRY }}/${{ env.DOCKER_IMAGE_NAME }}:${{ steps.sanitized_tag.outputs.result }} - name: Generate artifact attestation if: startsWith(github.ref, 'refs/tags/v') && endsWith(github.ref, '${{ env.MODULE_NAME }}')