Skip to content

Update Helm chart for Redis Operator #184

Update Helm chart for Redis Operator

Update Helm chart for Redis Operator #184

Workflow file for this run

name: CI
on:
pull_request:
branches:
- main
push:
branches:
- '**'
permissions:
contents: read
env:
GOLANG_VERSION: 1.21
APPLICATION_NAME: redis-operator
DOCKER_IMAGE_NAME: awbrg789/redis-operator
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Run GolangCI-Lint
uses: golangci/golangci-lint-action@v6
with:
version: v1.54.0
go-test:
needs:
- lint
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GOLANG_VERSION }}
- name: Install integration test dependencies
run: make test-env-setup
- name: Run Go Tests
run: go test ./... -coverprofile=coverage.txt -covermode=atomic
build_and_push:
needs:
- go-test
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Determine Docker Tag
id: determine_tag
run: |
if [ "${GITHUB_REF}" == "refs/heads/main" ]; then
echo "DOCKER_TAG=latest" >> $GITHUB_ENV
else
BRANCH_NAME=$(echo "${GITHUB_REF#refs/heads/}" | tr '/' '-')
echo "DOCKER_TAG=${BRANCH_NAME}" >> $GITHUB_ENV
fi
- name: Log in to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.DOCKER_IMAGE_NAME }}:${{ env.DOCKER_TAG }}