Commit 319010b 1 parent da3b2f2 commit 319010b Copy full SHA for 319010b
File tree 1 file changed +24
-2
lines changed
1 file changed +24
-2
lines changed Original file line number Diff line number Diff line change 1
1
name : Build & Push e2e-runner Image to Quay.io
2
2
3
3
on :
4
- pull_request :
4
+ push :
5
5
branches :
6
6
- main
7
+ - release-1.[0-9]+
7
8
paths :
8
9
- ' .ibm/images/Dockerfile'
9
10
- ' .yarnrc.yml'
11
+ workflow_dispatch :
12
+ inputs :
13
+ branch :
14
+ description : Target branch to build
15
+ required : true
16
+ default : ' NONE'
10
17
11
18
concurrency :
12
19
group : ${{ github.workflow }}-${{ github.ref }}
@@ -15,7 +22,6 @@ concurrency:
15
22
env :
16
23
REGISTRY : quay.io
17
24
REGISTRY_IMAGE : rhdh-community/rhdh-e2e-runner
18
- IMAGE_TAG : main
19
25
20
26
jobs :
21
27
build-image :
38
44
- name : Prepare Environment Variables
39
45
run : |
40
46
echo "PLATFORM=linux/amd64" >> $GITHUB_ENV
47
+ latestNext="next"
48
+ # for main branch, use next tags; for 1.y branches, use :latest tags
49
+ if [[ $(git rev-parse --abbrev-ref HEAD) != "main" ]]; then
50
+ latestNext="latest"
51
+ fi
52
+ echo "LATESTNEXT=${latestNext}" >> $GITHUB_ENV
53
+
54
+ # create image tag from the correct branch (either from a push or a workflow_dispatch trigger)
55
+ if [[ "${{ inputs.branch }}" != "NONE" ]]; then
56
+ git checkout "${{ inputs.branch }}"
57
+ IMAGE_TAG="${{ inputs.branch }}"
58
+ else
59
+ IMAGE_TAG=$(git rev-parse --abbrev-ref HEAD)
60
+ fi
61
+ echo "IMAGE_TAG=$IMAGE_TAG" >> $GITHUB_ENV
41
62
42
63
- name : Set up Docker Buildx
43
64
uses : docker/setup-buildx-action@v3
58
79
tags : |
59
80
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}
60
81
${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.IMAGE_TAG }}-${{ env.SHORT_SHA }}
82
+ ${{ env.REGISTRY }}/${{ env.REGISTRY_IMAGE }}:${{ env.LATESTNEXT }}
61
83
platforms : ${{ env.PLATFORM }}
You can’t perform that action at this time.
0 commit comments