Skip to content

fix: append licenses to code files (#64) #8

fix: append licenses to code files (#64)

fix: append licenses to code files (#64) #8

name: branch-pipeline
on:
push:
branches:
- main
- release-*
jobs:
test:
name: Test with Coverage
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Check out code
uses: actions/checkout@v4
- name: Install dependencies
run: |
go mod download
- name: Run Unit tests
run: |
make test
- name: Install goveralls
run: go install github.com/mattn/goveralls@latest
- name: Send coverage
env:
COVERALLS_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
run: goveralls -coverprofile=coverage.txt -service=github
build:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Generate tag
id: get_tag
run: |
if [ "${GITHUB_REF##*/}" = "main" ]; then
TAG_NAME="latest"
else
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
VERSION="${BRANCH_NAME#release-}"
LARGEST_TAG=$(git tag --merged $BRANCH_NAME --sort=-v:refname | grep $VERSION | head -n 1)
TAG_NAME="${LARGEST_TAG}-${GITHUB_SHA::7}"
fi
echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Docker Setup Buildx
id: buildx
uses: docker/setup-buildx-action@v3.0.0
- name: GitHub Login
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GH_TOKEN }}
- name: Build and push Docker image
uses: docker/build-push-action@v3
with:
file: ./Dockerfile
context: .
push: true
tags: ghcr.io/${{ github.repository_owner }}/redis-operator:${{ env.TAG_NAME }}
platforms: linux/amd64,linux/arm64