cert-manager-webhook-example/.github/workflows/build-images.yaml
Rémy Moll b5793bb12c
CI/CD using github actions and a custom dnsimple account (#31)
* restructure source and templates to follow helm best-practices

* add basic actions for more complex workflows

* workflows for pr ands tags (along with required fixes to go code)

* re-add helm chart and automated chart release

* fix errors in workflows

* improve documentation

* fix finding existing records

* add missing namespace to workflow

* cleanup of kubernetes pipeline

* Fixed and documented tagging workflow
2024-05-27 16:46:34 +02:00

49 lines
1.3 KiB
YAML

name: Build docker images
env:
DOCKER_BASE_NAME: 'ghcr.io/${{ github.repository_owner }}/cert-manager-webhook-dnsimple'
on:
workflow_call:
inputs:
tags:
description: 'Tags to build the image for (separated by a whitespace)'
required: true
type: string
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
password: ${{ secrets.GITHUB_TOKEN }}
username: ${{ github.repository_owner }}
- name: Format tags
id: format-tags
# prepends DOCKER_BASE_NAME to every entry in the string ${{ inputs.tags }}
run: |
echo "TAGS=$(printf '${{ env.DOCKER_BASE_NAME }}:%s,' ${{ inputs.tags }})" >> $GITHUB_OUTPUT
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.format-tags.outputs.TAGS }}