File tree 2 files changed +14
-7
lines changed
2 files changed +14
-7
lines changed Original file line number Diff line number Diff line change 6
6
push :
7
7
# Sequence of patterns matched against refs/heads
8
8
branches :
9
- - develop
10
- - master
9
+ - main
11
10
tags :
12
11
- " *"
13
12
@@ -23,16 +22,26 @@ jobs:
23
22
with :
24
23
go-version-file : go.mod
25
24
26
- # This step uses action-hub docker action: https://github.com/actions-hub/docker
27
25
- name : Login to docker hub
28
26
if : success()
29
27
uses : docker/login-action@v3
30
28
with :
31
29
username : ${{ secrets.DOCKER_USERNAME }}
32
30
password : ${{ secrets.DOCKER_PASSWORD }}
33
31
34
- # Build docker image
35
- - name : Build docker image
32
+ - name : Deduce image tag
33
+ run : |
34
+ if [[ -z "${IMAGE_TAG}" ]]; then \
35
+ IMAGE_TAG=${GITHUB_REF#*/}; \
36
+ IMAGE_TAG=${IMAGE_TAG#*/}; \
37
+ IMAGE_TAG=$(echo $IMAGE_TAG | sed -e "s#^v##"); \
38
+ if [[ "$IMAGE_TAG" == "master" || "$IMAGE_TAG" == "main" ]]; then \
39
+ IMAGE_TAG=latest; \
40
+ fi \
41
+ fi && \
42
+ echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
43
+
44
+ - name : Build and push docker image
36
45
if : success()
37
46
shell : bash
38
47
env :
Original file line number Diff line number Diff line change @@ -2,8 +2,6 @@ module quortex.io/kubestitute
2
2
3
3
go 1.22.0
4
4
5
- toolchain go1.22.5
6
-
7
5
require (
8
6
github.com/Masterminds/sprig/v3 v3.2.3
9
7
github.com/aws/aws-sdk-go v1.55.5
You can’t perform that action at this time.
0 commit comments