Skip to content

feat: 🤪 I never understood this helm chart releaser action logic #21

feat: 🤪 I never understood this helm chart releaser action logic

feat: 🤪 I never understood this helm chart releaser action logic #21

Workflow file for this run

name: CI
on:
push:
branches:
- main
- dev
tags:
- "*"
env:
REGISTRY: ghcr.io
IMAGE_NAME: sintef/cert-manager-webhook-gandi
jobs:
build-and-push-image:
name: Build and push Docker image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Get versions
id: versions
run: |
echo go_version=$(go mod edit -json | grep -Po '"Go":\s+"([0-9.]+)"' | sed -E 's/.+"([0-9.]+)"/\1/') >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for pre process image
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push
uses: docker/build-push-action@v3
with:
context: ./
push: true
build-args: GO_VERSION=${{ steps.versions.outputs.go_version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}