Skip to content

Commit e854d37

Browse files
rodion-mclaude
andcommitted
Make Docker Hub publish best-effort in Release workflow
The DOCKERHUB_USERNAME / DOCKERHUB_TOKEN secrets aren't configured in the `release` environment, so the Login step has been failing on every release attempt since e0415b5 added the dual-publish (3 failed releases in a row). That blocked the rest of the pipeline — git tag, MCP Registry publish, GitHub Release — all of which are independent of Docker Hub. Split the build into a primary GHCR push (always runs) and a secondary Docker Hub push that runs only when login succeeded. Add continue-on-error to the login itself so a missing secret no longer aborts the job. Configure DOCKERHUB_USERNAME / DOCKERHUB_TOKEN in the `release` environment to re-enable Docker Hub distribution. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 41efd19 commit e854d37

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,20 @@ jobs:
148148
username: ${{ github.actor }}
149149
password: ${{ secrets.GITHUB_TOKEN }}
150150

151+
# Docker Hub publish is a secondary distribution channel for self-hosted
152+
# customers. Treat it as best-effort: missing credentials must NOT block
153+
# the primary release path (GHCR push, MCP Registry publish, git tag,
154+
# GitHub Release). Configure DOCKERHUB_USERNAME / DOCKERHUB_TOKEN in the
155+
# `release` environment to re-enable.
151156
- name: Login to Docker Hub (self-hosted distribution)
157+
id: dockerhub_login
158+
continue-on-error: true
152159
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0
153160
with:
154161
username: ${{ secrets.DOCKERHUB_USERNAME }}
155162
password: ${{ secrets.DOCKERHUB_TOKEN }}
156163

157-
- name: Build and push Docker image
164+
- name: Build and push Docker image (GHCR)
158165
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
159166
with:
160167
push: true
@@ -165,12 +172,25 @@ jobs:
165172
${{ env.IMAGE_NAME }}:${{ steps.version.outputs.version }}
166173
${{ env.IMAGE_NAME }}:v${{ steps.version.outputs.version }}
167174
${{ env.IMAGE_NAME }}:latest
175+
labels: |
176+
io.modelcontextprotocol.server.name=io.github.CodeAlive-AI/codealive-mcp
177+
cache-from: type=gha
178+
cache-to: type=gha
179+
180+
- name: Build and push Docker image (Docker Hub)
181+
if: steps.dockerhub_login.outcome == 'success'
182+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
183+
with:
184+
push: true
185+
platforms: linux/amd64,linux/arm64
186+
file: ./Dockerfile
187+
build-args: VERSION=${{ steps.version.outputs.version }}
188+
tags: |
168189
${{ env.DOCKERHUB_IMAGE }}:mcp
169190
${{ env.DOCKERHUB_IMAGE }}:mcp-v${{ steps.version.outputs.version }}
170191
labels: |
171192
io.modelcontextprotocol.server.name=io.github.CodeAlive-AI/codealive-mcp
172193
cache-from: type=gha
173-
cache-to: type=gha
174194

175195
# Git tag created AFTER Docker push succeeds — if Docker fails, no stale tag
176196
- name: Create and push git tag

0 commit comments

Comments
 (0)