Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/container-build-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Convert Repository Name to Lowercase
id: repository_to_lower_case
run: |
echo "repo_lower=$(echo '${{ github.repository }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV

- name: Login to GitHub Container Registry
if: ${{ inputs.push }}
uses: docker/login-action@v3
Expand All @@ -37,17 +42,17 @@ jobs:
id: build-push
uses: docker/build-push-action@v6
with:
cache-from: "ghcr.io/${{ github.repository }}/tools:latest"
cache-from: "ghcr.io/${{ steps.repository_to_lower_case.outputs.repo_lower }}/tools:latest"
file: docker/Dockerfile
context: docker
tags: "ghcr.io/${{ github.repository_owner }}/${{ github.repository }}/tools:${{ inputs.tag }}"
tags: "ghcr.io/${{ steps.repository_to_lower_case.outputs.repo_lower }}/tools:${{ inputs.tag }}"
platforms: ${{ inputs.platforms }}
push: ${{ inputs.push }}

- name: Generate Artifact Attestation
if: ${{ inputs.push }}
uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/${{ github.repository }}
subject-name: ghcr.io/${{ steps.repository_to_lower_case.outputs.repo_lower }}
subject-digest: ${{ steps.build-push.outputs.digest }}
push-to-registry: true