revert(ci): restore two-build docker.yml publish

#2122 collapsed the per-registry builds into one build with two type=image
outputs and a single steps.build.outputs.digest. With build-push-action's
default provenance attestation, that digest does not resolve at ghcr, so the
multi-arch manifest step fails ("ghcr.io/...@sha256:...: not found"). Restore
the separate build-ghcr / build-dockerhub steps so each registry gets its own
digest. The ci-build.yml type=gha cache change from #2122 is kept.
This commit is contained in:
Umputun
2026-07-11 02:18:00 -05:00
parent 2544d80f98
commit e575066ea9
+25 -12
View File
@@ -62,14 +62,14 @@ jobs:
sudo rm -rf /usr/local/share/boost
docker system prune -af
- name: build once and push to both registries by digest
id: build
- name: build and push to ghcr.io by digest
id: build-ghcr
uses: docker/build-push-action@v7
with:
context: .
platforms: ${{ matrix.platform }}
cache-from: type=gha,scope=${{ matrix.platform }}
cache-to: type=gha,scope=${{ matrix.platform }},mode=max,ignore-error=true
cache-to: type=gha,scope=${{ matrix.platform }},mode=max
build-args: |
SKIP_BACKEND_TEST=true
SKIP_FRONTEND_TEST=true
@@ -77,18 +77,31 @@ jobs:
GITHUB_SHA=${{ github.event.workflow_run.head_sha }}
GIT_BRANCH=${{ github.event.workflow_run.head_branch }}
GITHUB_REF=refs/heads/${{ github.event.workflow_run.head_branch }}
outputs: |
type=image,name=ghcr.io/umputun/remark42,push-by-digest=true,name-canonical=true,push=true
type=image,name=umputun/remark42,push-by-digest=true,name-canonical=true,push=true
outputs: type=image,name=ghcr.io/umputun/remark42,push-by-digest=true,name-canonical=true,push=true
- name: export digest
- name: build and push to DockerHub by digest
id: build-dockerhub
uses: docker/build-push-action@v7
with:
context: .
platforms: ${{ matrix.platform }}
cache-from: type=gha,scope=${{ matrix.platform }}
build-args: |
SKIP_BACKEND_TEST=true
SKIP_FRONTEND_TEST=true
CI=github
GITHUB_SHA=${{ github.event.workflow_run.head_sha }}
GIT_BRANCH=${{ github.event.workflow_run.head_branch }}
GITHUB_REF=refs/heads/${{ github.event.workflow_run.head_branch }}
outputs: type=image,name=umputun/remark42,push-by-digest=true,name-canonical=true,push=true
- name: export digests
run: |
# both registries receive the same content-addressed image, so the
# single build digest applies to each
mkdir -p /tmp/digests/ghcr /tmp/digests/dockerhub
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/ghcr/${digest#sha256:}"
touch "/tmp/digests/dockerhub/${digest#sha256:}"
digest_ghcr="${{ steps.build-ghcr.outputs.digest }}"
digest_dockerhub="${{ steps.build-dockerhub.outputs.digest }}"
touch "/tmp/digests/ghcr/${digest_ghcr#sha256:}"
touch "/tmp/digests/dockerhub/${digest_dockerhub#sha256:}"
- name: upload ghcr digest
uses: actions/upload-artifact@v7