diff --git a/.github/workflows/release-image.yml b/.github/workflows/release-image.yml index de6f9bb..dd7a4dc 100644 --- a/.github/workflows/release-image.yml +++ b/.github/workflows/release-image.yml @@ -96,6 +96,9 @@ jobs: "./target": "/app/target" } # skip-extraction: ${{ steps.rust-cache.outputs.cache-hit }} + # We get the git commit timestamp, to use for reproducible builds (SOURCE_DATE_EPOCH) + - name: Get Git commit timestamps + run: echo "TIMESTAMP=$(git log -1 --pretty=%ct)" >> $GITHUB_ENV # This step uses the `docker/build-push-action` action to build the image, based on your repository's `Dockerfile`. If the build succeeds, it pushes the image to GitHub Packages. # It uses the `context` parameter to define the build's context as the set of files located in the specified path. For more information, see "[Usage](https://github.com/docker/build-push-action#usage)" in the README of the `docker/build-push-action` repository. # It uses the `tags` and `labels` parameters to tag and label the image with the output from the "meta" step. @@ -111,6 +114,8 @@ jobs: cache-from: type=gha cache-to: type=gha,mode=max sbom: true + env: + SOURCE_DATE_EPOCH: ${{ env.TIMESTAMP }} # This step generates an artifact attestation for the image, which is an unforgeable statement about where and how it was built. It increases supply chain security for people who consume the image. For more information, see "[Using artifact attestations to establish provenance for builds](https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds)." - name: Generate artifact attestation (${{ steps.var.outputs.docker_image }})