Skip to content

Free, Open Source, Self-Hosted WhatsApp API Gateway

ci(release): dual-publish images to Docker Hub alongside GHCR

Yudhi Armyndharis81119577f2f6
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index ba0427294..8e501ec80 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -376,10 +376,12 @@ jobs:
done
exit "$exit_code"
- # Applies the release tags (X.Y.Z, X.Y, latest) to the image boot-smoke just proved can start.
- # `imagetools create` re-points tags at the existing manifest list without rebuilding, so the
- # promoted image is bit-identical to the one tested, and its provenance and SBOM attestations
- # travel with it. If boot-smoke fails, this job never runs and the release tags never appear.
+ # Applies the release tags (X.Y.Z, X.Y, latest) to the image boot-smoke just proved can start, on
+ # BOTH registries (GHCR + Docker Hub — the metadata-action `images` list emits both, and the loop
+ # below promotes each). `imagetools create` re-points tags at the existing manifest list without
+ # rebuilding, so the promoted image is bit-identical to the one tested on both registries, and its
+ # provenance and SBOM attestations travel with it. If boot-smoke fails, this job never runs and the
+ # release tags never appear anywhere.
promote:
name: Promote image to release tags
runs-on: ubuntu-latest
@@ -397,11 +399,22 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
+ # Dual-publish: the same boot-tested manifest is also tagged on Docker Hub, where the public
+ # pull count lives (GHCR exposes no download metrics). Requires the DOCKERHUB_USERNAME /
+ # DOCKERHUB_TOKEN repo secrets; without them this step fails before any tag is applied.
+ - name: Login to Docker Hub
+ uses: docker/login-action@v4
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+
- name: Extract metadata
id: meta
uses: docker/metadata-action@v6
with:
- images: ghcr.io/${{ github.repository }}
+ images: |
+ ghcr.io/${{ github.repository }}
+ docker.io/rmyndharis/openwa
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
@@ -507,28 +520,29 @@ jobs:
set -euo pipefail
version="${GITHUB_REF#refs/tags/v}"
minor="${version%.*}"
- expected=3
+ expected=6
checked=0
failed=0
for tag in "$version" "$minor" latest; do
- ref="ghcr.io/${REPO,,}:${tag}"
- echo "::group::$ref"
- if ! docker buildx imagetools inspect "$ref" > "/tmp/pub-${tag}.txt" 2>&1; then
- echo "::error::$ref is not publicly pullable after promotion."
- cat "/tmp/pub-${tag}.txt"
- failed=1
- echo "::endgroup::"
- continue
- fi
- for want in linux/amd64 linux/arm64; do
- if ! grep -q "$want" "/tmp/pub-${tag}.txt"; then
- echo "::error::$ref resolves but is missing $want"
+ for ref in "ghcr.io/${REPO,,}:${tag}" "docker.io/rmyndharis/openwa:${tag}"; do
+ echo "::group::$ref"
+ if ! docker buildx imagetools inspect "$ref" > "/tmp/pub-${tag}.txt" 2>&1; then
+ echo "::error::$ref is not publicly pullable after promotion."
+ cat "/tmp/pub-${tag}.txt"
failed=1
+ echo "::endgroup::"
+ continue
fi
+ for want in linux/amd64 linux/arm64; do
+ if ! grep -q "$want" "/tmp/pub-${tag}.txt"; then
+ echo "::error::$ref resolves but is missing $want"
+ failed=1
+ fi
+ done
+ echo "$ref OK"
+ checked=$((checked + 1))
+ echo "::endgroup::"
done
- echo "$ref OK"
- checked=$((checked + 1))
- echo "::endgroup::"
done
if [ "$checked" -ne "$expected" ]; then
echo "::error::only verified $checked of $expected tags — treating that as a failed release."