@@ -202,15 +202,18 @@ jobs:
202202 --title "v${{ steps.extract-version.outputs.new-version }}" \
203203 --notes-file "${{ steps.version-bump-summary.outputs.text-file }}"
204204
205- publish -express-to-docker-hub :
206- name : Publish Express To Docker Hub
205+ get -express-release-context :
206+ name : Get Express release context
207207 if : inputs.dry-run == false
208208 needs :
209- - get-release-context
210209 - release-bitgojs
211210 runs-on : ${{ vars.BASE_RUNNER_TYPE || 'ubuntu-latest' }}
212- timeout-minutes : 40
213- environment : bitgo-express
211+ timeout-minutes : 10
212+ outputs :
213+ version : ${{ steps.compute-express-git-tag.outputs.version }}
214+ git-tag : ${{ steps.compute-express-git-tag.outputs.git-tag }}
215+ git-sha : ${{ steps.compute-express-git-sha.outputs.git-sha }}
216+ docker-exists : ${{ steps.check-docker-image.outputs.docker-exists }}
214217 steps :
215218 - name : Checkout rel/latest branch
216219 uses : actions/checkout@v6
@@ -229,35 +232,20 @@ jobs:
229232 echo "version=$VERSION" >> "$GITHUB_OUTPUT"
230233 echo "git-tag=$TAG" >> "$GITHUB_OUTPUT"
231234
232- - name : Check if Docker image already exists in Docker Hub
233- id : check-docker-image
234- run : |
235- VERSION="${{ steps.compute-express-git-tag.outputs.version }}"
236- if curl -s -f "https://hub.docker.com/v2/repositories/bitgo/express/tags/$VERSION" > /dev/null; then
237- echo "⚠️ Docker image bitgo/express:$VERSION already exists — skipping publish"
238- echo "express-docker-exists=true" >> "$GITHUB_OUTPUT"
239- else
240- echo "✅ Docker image bitgo/express:$VERSION does not exist — will publish"
241- echo "express-docker-exists=false" >> "$GITHUB_OUTPUT"
242- fi
243-
244235 - name : Checkout express target git tag
245- if : steps.check-docker-image.outputs.express-docker-exists != 'true'
246236 uses : actions/checkout@v6
247237 with :
248238 ref : ${{ steps.compute-express-git-tag.outputs.git-tag }}
249239 fetch-depth : 2
250240
251241 - name : Parse express git SHA
252- if : steps.check-docker-image.outputs.express-docker-exists != 'true'
253242 id : compute-express-git-sha
254243 run : |
255244 GIT_SHA=$(git rev-parse HEAD)
256245 echo "Git SHA: $GIT_SHA"
257246 echo "git-sha=$GIT_SHA" >> "$GITHUB_OUTPUT"
258247
259248 - name : Sanity Check Express Git Tag
260- if : steps.check-docker-image.outputs.express-docker-exists != 'true'
261249 run : |
262250 CURRENT_VERSION="${{ steps.compute-express-git-tag.outputs.version }}"
263251 PREVIOUS_VERSION=$(git show HEAD~1:./modules/express/package.json | jq -r '.version')
@@ -273,9 +261,21 @@ jobs:
273261
274262 echo "✅ Express version bump lines up with git tag"
275263
264+ - name : Check if Docker image already exists in Docker Hub
265+ id : check-docker-image
266+ run : |
267+ VERSION="${{ steps.compute-express-git-tag.outputs.version }}"
268+ if curl -s -f "https://hub.docker.com/v2/repositories/bitgo/express/tags/$VERSION" > /dev/null; then
269+ echo "⚠️ Docker image bitgo/express:$VERSION already exists — skipping publish"
270+ echo "docker-exists=true" >> "$GITHUB_OUTPUT"
271+ else
272+ echo "✅ Docker image bitgo/express:$VERSION does not exist — will publish"
273+ echo "docker-exists=false" >> "$GITHUB_OUTPUT"
274+ fi
275+
276276 - name : Update Express GitHub summary
277277 run : |
278- if [ "${{ steps.check-docker-image.outputs.express- docker-exists }}" == "true" ]; then
278+ if [ "${{ steps.check-docker-image.outputs.docker-exists }}" == "true" ]; then
279279 {
280280 echo "### ⚠️ Docker publish skipped"
281281 echo "Image \`bitgo/express:${{ steps.compute-express-git-tag.outputs.version }}\` already exists in Docker Hub."
@@ -295,26 +295,36 @@ jobs:
295295 } >> "$GITHUB_STEP_SUMMARY"
296296 fi
297297
298+ publish-express-to-docker-hub :
299+ name : Publish Express To Docker Hub
300+ if : needs.get-express-release-context.outputs.docker-exists != 'true'
301+ needs :
302+ - get-express-release-context
303+ runs-on : ${{ vars.BASE_RUNNER_TYPE || 'ubuntu-latest' }}
304+ timeout-minutes : 40
305+ environment : bitgo-express
306+ steps :
307+ - name : Checkout BitGoJS repository
308+ uses : actions/checkout@v6
309+ with :
310+ ref : ${{ needs.get-express-release-context.outputs.git-sha }}
311+
298312 - name : Set up Docker Buildx
299- if : steps.check-docker-image.outputs.express-docker-exists != 'true'
300313 uses : docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0
301314
302315 - name : Log in to Docker Hub
303- if : steps.check-docker-image.outputs.express-docker-exists != 'true'
304316 uses : docker/login-action@v4
305317 with :
306318 username : ${{ env.DOCKER_HUB_USERNAME }}
307319 password : ${{ secrets.DOCKER_HUB_API_KEY }}
308320
309321 - name : Generate build date
310- if : steps.check-docker-image.outputs.express-docker-exists != 'true'
311322 id : build-date
312323 run : |
313324 BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
314325 echo "build-date=$BUILD_DATE" >> "$GITHUB_OUTPUT"
315326
316327 - name : Build and push Express Docker image
317- if : steps.check-docker-image.outputs.express-docker-exists != 'true'
318328 id : docker-build
319329 uses : docker/build-push-action@v7
320330 with :
@@ -323,8 +333,8 @@ jobs:
323333 push : true
324334 tags : |
325335 bitgo/express:latest
326- bitgo/express:${{ steps.compute -express-git-tag .outputs.version }}
336+ bitgo/express:${{ needs.get -express-release-context .outputs.version }}
327337 build-args : |
328- VERSION=${{ steps.compute -express-git-tag .outputs.version }}
338+ VERSION=${{ needs.get -express-release-context .outputs.version }}
329339 BUILD_DATE=${{ steps.build-date.outputs.build-date }}
330- GIT_HASH=${{ steps.compute -express-git-sha .outputs.git-sha }}
340+ GIT_HASH=${{ needs.get -express-release-context .outputs.git-sha }}
0 commit comments