A continuation of HomeBox the inventory and organization system built for the Home User
Update docker publish actions to potentially fix issues with Docker Hub attestation
Phil5af2317284e9
diff --git a/.github/workflows/docker-publish-hardened.yaml b/.github/workflows/docker-publish-hardened.yamlindex 9b8dae24..9a3139b3 100644--- a/.github/workflows/docker-publish-hardened.yaml+++ b/.github/workflows/docker-publish-hardened.yaml@@ -39,7 +39,7 @@ jobs:packages: writeid-token: writeattestations: write-+strategy:fail-fast: falsematrix:@@ -67,7 +67,7 @@ jobs:branch=${{ github.event.pull_request.number || github.ref_name }}echo "BRANCH=${branch//\//-}" >> $GITHUB_ENVecho "DOCKERNAMES=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}" >> $GITHUB_ENV- if [[ "${{ github.event_name }}" != "schedule" ]] || [[ "${{ github.ref }}" != refs/tags/* ]]; then+ if [[ "${{ github.event_name }}" != "schedule" ]] && [[ "${{ github.ref }}" != refs/tags/* ]]; thenecho "DOCKERNAMES=${{ env.GHCR_REPO }}" >> $GITHUB_ENVfi@@ -255,4 +255,4 @@ jobs:with:subject-name: docker.io/${{ env.DOCKERHUB_REPO }}subject-digest: ${{ steps.push-dockerhub.outputs.digest }}- push-to-registry: true+ push-to-registry: true\ No newline at end of filediff --git a/.github/workflows/docker-publish-rootless.yaml b/.github/workflows/docker-publish-rootless.yamlindex e2b666d3..4fc8dd66 100644--- a/.github/workflows/docker-publish-rootless.yaml+++ b/.github/workflows/docker-publish-rootless.yaml@@ -70,7 +70,7 @@ jobs:branch=${{ github.event.pull_request.number || github.ref_name }}echo "BRANCH=${branch//\//-}" >> $GITHUB_ENVecho "DOCKERNAMES=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}" >> $GITHUB_ENV- if [[ "${{ github.event_name }}" != "schedule" ]] || [[ "${{ github.ref }}" != refs/tags/* ]]; then+ if [[ "${{ github.event_name }}" != "schedule" ]] && [[ "${{ github.ref }}" != refs/tags/* ]]; thenecho "DOCKERNAMES=${{ env.GHCR_REPO }}" >> $GITHUB_ENVfi@@ -257,4 +257,4 @@ jobs:with:subject-name: docker.io/${{ env.DOCKERHUB_REPO }}subject-digest: ${{ steps.push-dockerhub.outputs.digest }}- push-to-registry: true+ push-to-registry: true\ No newline at end of filediff --git a/.github/workflows/docker-publish.yaml b/.github/workflows/docker-publish.yamlindex f9f3d9d4..2a2643e5 100644--- a/.github/workflows/docker-publish.yaml+++ b/.github/workflows/docker-publish.yaml@@ -39,10 +39,10 @@ jobs:build:runs-on: ${{ matrix.runner }}permissions:- contents: read # Allows access to repository contents (read-only)- packages: write # Allows pushing to GHCR- id-token: write # Allows identity token write access for authentication- attestations: write # Needed for signing and attestation (if required)+ contents: read+ packages: write+ id-token: write+ attestations: writestrategy:fail-fast: false@@ -54,6 +54,12 @@ jobs:runner: ubuntu-24.04-armsteps:+ - name: Enable Debug Logs+ run: echo "##[debug]Enabling debug logging"+ env:+ ACTIONS_RUNNER_DEBUG: true+ ACTIONS_STEP_DEBUG: true+- name: Checkout repositoryuses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8@@ -64,7 +70,7 @@ jobs:branch=${{ github.event.pull_request.number || github.ref_name }}echo "BRANCH=${branch//\//-}" >> $GITHUB_ENVecho "DOCKERNAMES=${{ env.DOCKERHUB_REPO }},${{ env.GHCR_REPO }}" >> $GITHUB_ENV- if [[ "${{ github.event_name }}" != "schedule" ]] || [[ "${{ github.ref }}" != refs/tags/* ]]; then+ if [[ "${{ github.event_name }}" != "schedule" ]] && [[ "${{ github.ref }}" != refs/tags/* ]]; thenecho "DOCKERNAMES=${{ env.GHCR_REPO }}" >> $GITHUB_ENVfi@@ -107,20 +113,22 @@ jobs:uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435with:driver-opts: |- image=ghcr.io/sysadminsmedia/buildkit:latest+ image=ghcr.io/sysadminsmedia/buildkit:master- name: Build and push by digestid: builduses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83with:+ context: . # Explicitly specify the build context+ file: ./Dockerfile # Explicitly specify the Dockerfileplatforms: ${{ matrix.platform }}labels: ${{ steps.meta.outputs.labels }}outputs: type=image,"name=${{ env.DOCKERNAMES }}",push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}cache-from: type=registry,ref=ghcr.io/sysadminsmedia/devcache:${{ env.PLATFORM_PAIR }}-${{ env.BRANCH }}- cache-to: type=registry,ref=ghcr.io/sysadminsmedia/devcache:${{ env.PLATFORM_PAIR}}-${{ env.BRANCH }},mode=max,ignore-error=true+ cache-to: type=registry,ref=ghcr.io/sysadminsmedia/devcache:${{ env.PLATFORM_PAIR }}-${{ env.BRANCH }},mode=max,ignore-error=truebuild-args: |VERSION=${{ github.ref_name }}- COMMIT=${{ github.sha }}+ COMMIT=${{ github.sha }}provenance: mode=maxsbom: trueannotations: ${{ steps.meta.outputs.annotations }}@@ -132,7 +140,7 @@ jobs:subject-name: ${{ env.GHCR_REPO }}subject-digest: ${{ steps.build.outputs.digest }}push-to-registry: true-+- name: Export digestrun: |mkdir -p /tmp/digests@@ -151,10 +159,10 @@ jobs:if: github.event_name != 'pull_request'runs-on: ubuntu-latestpermissions:- contents: read # Allows access to repository contents (read-only)- packages: write # Allows pushing to GHCR- id-token: write # Allows identity token write access for authentication- attestations: write # Needed for signing and attestation (if required)+ contents: read+ packages: write+ id-token: write+ attestations: writeneeds:- build@@ -246,4 +254,4 @@ jobs:with:subject-name: docker.io/${{ env.DOCKERHUB_REPO }}subject-digest: ${{ steps.push-dockerhub.outputs.digest }}- push-to-registry: true+ push-to-registry: true\ No newline at end of file