diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 68691d8..b4fb984 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -32,14 +32,9 @@ jobs: registry: ${{ env.REGISTRY }} 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 }} - tags: | - type=raw,value=${{ github.ref_name }}-${{ github.sha }} - type=sha,format=short + - name: Get short commit hash + id: get-short-hash + run: echo "SHORT_COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV - name: Build and push Docker image id: push uses: docker/build-push-action@v6 @@ -47,8 +42,10 @@ jobs: context: . file: Dockerfile push: true - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} + tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ github.ref_name }}-${{ env.SHORT_COMMIT_HASH }} + labels: | + version=${{ env.SHORT_COMMIT_HASH }} + branch=${{ github.ref_name }} - name: Generate artifact attestation uses: actions/attest-build-provenance@v1 with: