Skip to content

Commit

Permalink
Fix build CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
antonincms committed Aug 5, 2024
1 parent 2d8cd56 commit 1f167d8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ on:
push:
# Sequence of patterns matched against refs/heads
branches:
- develop
- master
- main
tags:
- "*"

Expand All @@ -23,16 +22,26 @@ jobs:
with:
go-version-file: go.mod

# This step uses action-hub docker action: https://github.com/actions-hub/docker
- name: Login to docker hub
if: success()
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

# Build docker image
- name: Build docker image
- name: Deduce image tag
run: |
if [[ -z "${IMAGE_TAG}" ]]; then \
IMAGE_TAG=${GITHUB_REF#*/}; \
IMAGE_TAG=${IMAGE_TAG#*/}; \
IMAGE_TAG=$(echo $IMAGE_TAG | sed -e "s#^v##"); \
if [[ "$IMAGE_TAG" == "master" || "$IMAGE_TAG" == "main" ]]; then \
IMAGE_TAG=latest; \
fi \
fi && \
echo "IMAGE_TAG=${IMAGE_TAG}" >> $GITHUB_ENV
- name: Build and push docker image
if: success()
shell: bash
env:
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ module quortex.io/kubestitute

go 1.22.0

toolchain go1.22.5

require (
github.com/Masterminds/sprig/v3 v3.2.3
github.com/aws/aws-sdk-go v1.55.5
Expand Down

0 comments on commit 1f167d8

Please sign in to comment.