Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CI build workflow #298

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading