diff --git a/.github/workflows/build-push-docker-image.yml b/.github/workflows/build-push-docker-image.yml index 9a6ad2a32..c979aa0cf 100644 --- a/.github/workflows/build-push-docker-image.yml +++ b/.github/workflows/build-push-docker-image.yml @@ -16,10 +16,10 @@ jobs: - name: Get the latest release id: release - uses: robinraju/release-downloader@v1.7 + uses: robinraju/release-downloader@v1.9 with: latest: true - fileName: "*.tar.bz2" + fileName: "*.tar.gz" - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -28,20 +28,32 @@ jobs: uses: docker/setup-buildx-action@v2 - name: Login to GitHub Container Registry - uses: docker/login-action@v2 + uses: docker/login-action@v3 with: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set docker metadata for the container + id: meta + uses: docker/metadata-action@v5 + with: + images: | + ghcr.io/openconext/openconext-profile/profile + tags: | + type=ref,event=tag + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + - name: Build and push the Production image - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v5 with: context: . file: docker/Dockerfile.prod platforms: linux/amd64 push: true - tags: | - ghcr.io/openconext/openconext-profile/openconext-profile:prod - ghcr.io/openconext/openconext-profile/openconext-profile:${{ github.sha }} - ghcr.io/openconext/openconext-profile/openconext-profile:${{ steps.release.outputs.tag_name }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}