File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change 6
6
workflow_dispatch :
7
7
inputs :
8
8
branch-or-tag :
9
- description : " Branch or tag to use for the Docker image tag (optional)"
9
+ description : " Branch or tag to use for the Docker image tag and ref to checkout (optional)"
10
10
required : false
11
11
default : " "
12
12
27
27
runs-on : SubtensorCI
28
28
29
29
steps :
30
+ - name : Determine Docker tag and ref
31
+ id : tag
32
+ run : |
33
+ # Use the provided branch-or-tag input or fallback to the current ref
34
+ branch_or_tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}"
35
+ echo "Determined branch or tag: $branch_or_tag"
36
+ echo "tag=$branch_or_tag" >> $GITHUB_ENV
37
+ echo "ref=$branch_or_tag" >> $GITHUB_ENV
38
+
30
39
- name : Checkout code
31
40
uses : actions/checkout@v4
41
+ with :
42
+ ref : ${{ env.ref }}
32
43
33
44
- name : Set up QEMU
34
45
uses : docker/setup-qemu-action@v2
43
54
username : ${{ github.actor }}
44
55
password : ${{ secrets.GITHUB_TOKEN }}
45
56
46
- - name : Determine Docker tag
47
- id : tag
48
- run : |
49
- # Use the provided branch-or-tag input or fallback to the current ref
50
- branch_or_tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}"
51
- echo "Determined branch or tag: $branch_or_tag"
52
- echo "tag=$branch_or_tag" >> $GITHUB_ENV
53
-
54
57
- name : Build and push Docker image
55
58
uses : docker/build-push-action@v4
56
59
with :
You can’t perform that action at this time.
0 commit comments