Skip to content

Commit d49f06a

Browse files
committed
update.
1 parent 9648bb5 commit d49f06a

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

.github/workflows/docker-build.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ name: Build Docker Images
33
on:
44
push:
55
branches: [ main, movement, ci/* ]
6+
tags:
7+
- 'v*'
8+
- 'release-*'
69
workflow_dispatch:
710
inputs:
11+
ref:
12+
description: 'Branch, tag, or SHA to build (e.g., main, v1.0.0, abc123)'
13+
required: false
14+
default: ''
815
GIT_SHA:
9-
description: 'Git SHA to build'
16+
description: 'Git SHA to build (deprecated - use ref instead)'
1017
required: false
1118
FEATURES:
1219
description: 'Cargo features to enable'
@@ -28,7 +35,8 @@ jobs:
2835
- uses: actions/checkout@v3
2936
with:
3037
fetch-depth: 0 # Fetch all history
31-
ref: ${{ github.ref }} # Use the full ref to ensure we're on the right branch
38+
# Use ref input if provided (manual trigger), otherwise GIT_SHA (backward compat), otherwise github.ref (push trigger)
39+
ref: ${{ inputs.ref || inputs.GIT_SHA || github.ref }}
3240
token: ${{ secrets.GH_PAT }} # Use PAT for checkout
3341

3442
- name: Set up Docker Buildx
@@ -43,10 +51,25 @@ jobs:
4351

4452
- name: Build and Push Images
4553
run: |
46-
export TARGET_CACHE_ID=${GITHUB_REF#refs/heads/}
54+
# Determine the cache ID from ref input or github ref
55+
if [ -n "${{ inputs.ref }}" ]; then
56+
export TARGET_CACHE_ID="${{ inputs.ref }}"
57+
else
58+
export TARGET_CACHE_ID=${GITHUB_REF#refs/heads/}
59+
fi
60+
4761
export GHCR_ORG="movementlabsxyz"
48-
export PROFILE=${PROFILE:-release}
49-
export FEATURES=${FEATURES:-""}
62+
export PROFILE=${{ inputs.PROFILE || 'release' }}
63+
export FEATURES="${{ inputs.FEATURES }}"
5064
export CARGO_TARGET_DIR="target/${FEATURES:-default}"
65+
export CI=true
66+
67+
# Show build configuration
68+
echo "Building with:"
69+
echo " TARGET_CACHE_ID: $TARGET_CACHE_ID"
70+
echo " PROFILE: $PROFILE"
71+
echo " FEATURES: $FEATURES"
72+
echo " Git SHA: $(git rev-parse HEAD)"
73+
echo " Git Branch/Tag: $(git rev-parse --abbrev-ref HEAD)"
5174
5275
docker/builder/docker-bake-rust-all.sh

0 commit comments

Comments
 (0)