diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 57611f1f42..0d61022ee7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -6,6 +6,7 @@ on: env: REGISTRY: ghcr.io + IMAGE_NAME: ${{ github.repository }} jobs: build: @@ -13,6 +14,8 @@ jobs: permissions: contents: read packages: write + attestations: write + id-token: write steps: - name: Checkout @@ -27,13 +30,21 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Extract metadata (tags, labels) for Docker + id: meta + uses: docker/metadata-action@v5 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + - name: Build and push slim uses: docker/build-push-action@v4 with: context: . file: ./Dockerfile.slim push: true - tags: ${{ env.REGISTRY }}/apeworx/ape:latest-slim + tags: ${{ steps.meta.outputs.tags }}-slim + labels: ${{ steps.meta.outputs.labels }} - name: Build and push uses: docker/build-push-action@v4 @@ -41,6 +52,7 @@ jobs: context: . file: ./Dockerfile push: true - tags: ${{ env.Registry }}/apeworx/ape:latest + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }}