Skip to content

fix: cleanup go.mod dependencies #7

fix: cleanup go.mod dependencies

fix: cleanup go.mod dependencies #7

Workflow file for this run

name: build-image
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up version variables
id: vars
run: |
VERSION=${{ github.ref_name }}
MAJOR=$(echo $VERSION | cut -d. -f1)
MINOR=$(echo $VERSION | cut -d. -f2)
REPO_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "MAJOR=$MAJOR" >> $GITHUB_ENV
echo "MINOR=$MINOR" >> $GITHUB_ENV
echo "REPO_NAME=$REPO_NAME" >> $GITHUB_ENV
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
file: Containerfile
push: true
sbom: true
build-args: |
GITLAB_SYNC_VERSION=${{ github.ref_name }}
tags: |
ghcr.io/${{ env.REPO_NAME }}:${{ github.ref_name }}
ghcr.io/${{ env.REPO_NAME }}:${{ env.MAJOR }}.${{ env.MINOR }}
ghcr.io/${{ env.REPO_NAME }}:${{ env.MAJOR }}
ghcr.io/${{ env.REPO_NAME }}:latest