@@ -3,10 +3,17 @@ name: Build Docker Images
3
3
on :
4
4
push :
5
5
branches : [ main, movement, ci/* ]
6
+ tags :
7
+ - ' v*'
8
+ - ' release-*'
6
9
workflow_dispatch :
7
10
inputs :
11
+ ref :
12
+ description : ' Branch, tag, or SHA to build (e.g., main, v1.0.0, abc123)'
13
+ required : false
14
+ default : ' '
8
15
GIT_SHA :
9
- description : ' Git SHA to build'
16
+ description : ' Git SHA to build (deprecated - use ref instead) '
10
17
required : false
11
18
FEATURES :
12
19
description : ' Cargo features to enable'
28
35
- uses : actions/checkout@v3
29
36
with :
30
37
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 }}
32
40
token : ${{ secrets.GH_PAT }} # Use PAT for checkout
33
41
34
42
- name : Set up Docker Buildx
@@ -43,10 +51,25 @@ jobs:
43
51
44
52
- name : Build and Push Images
45
53
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
+
47
61
export GHCR_ORG="movementlabsxyz"
48
- export PROFILE=${PROFILE:- release}
49
- export FEATURES=${ FEATURES:-""}
62
+ export PROFILE=${{ inputs. PROFILE || ' release' } }
63
+ export FEATURES="${{ inputs. FEATURES }}"
50
64
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)"
51
74
52
75
docker/builder/docker-bake-rust-all.sh
0 commit comments