File tree Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Expand file tree Collapse file tree 1 file changed +22
-9
lines changed Original file line number Diff line number Diff line change 4
4
release :
5
5
types : [published]
6
6
workflow_dispatch :
7
+ inputs :
8
+ branch-or-tag :
9
+ description : " Branch or tag to use for the Docker image tag and ref to checkout (optional)"
10
+ required : false
11
+ default : " "
12
+
13
+ push :
14
+ branches :
15
+ - devnet-ready
16
+ - devnet
17
+ - testnet
7
18
8
19
permissions :
9
20
contents : read
16
27
runs-on : SubtensorCI
17
28
18
29
steps :
30
+ - name : Determine Docker tag and ref
31
+ id : tag
32
+ run : |
33
+ branch_or_tag="${{ github.event.inputs.branch-or-tag || github.ref_name }}"
34
+ echo "Determined branch or tag: $branch_or_tag"
35
+ echo "tag=$branch_or_tag" >> $GITHUB_ENV
36
+ echo "ref=$branch_or_tag" >> $GITHUB_ENV
37
+
19
38
- name : Checkout code
20
39
uses : actions/checkout@v4
40
+ with :
41
+ ref : ${{ env.ref }}
21
42
22
43
- name : Set up QEMU
23
44
uses : docker/setup-qemu-action@v2
@@ -32,18 +53,10 @@ jobs:
32
53
username : ${{ github.actor }}
33
54
password : ${{ secrets.GITHUB_TOKEN }}
34
55
35
- - name : Extract metadata (tags, labels) for Docker
36
- id : meta
37
- uses : docker/metadata-action@v4
38
- with :
39
- images : ghcr.io/${{ github.repository }}
40
-
41
56
- name : Build and push Docker image
42
57
uses : docker/build-push-action@v4
43
58
with :
44
59
context : .
45
60
push : true
46
61
tags : |
47
- ${{ steps.meta.outputs.tags }}
48
- ghcr.io/${{ github.repository }}:latest
49
- labels : ${{ steps.meta.outputs.labels }}
62
+ ghcr.io/${{ github.repository }}:${{ env.tag }}
You can’t perform that action at this time.
0 commit comments