Skip to content

Build Images

Build Images #70

Workflow file for this run

name: Build Images
on:
workflow_dispatch:
env:
REGISTRY: ghcr.io
USERNAME: ${{ github.actor }}
IMAGE_NAME: aellwein/cert-manager-webhook-netcup
# set version here for upcoming release
IMAGE_TAG: 1.0.32
IMAGE_TAG_DEVELOP: develop
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Login to container registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Build & push Docker image (all architectures)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
if: github.ref == 'refs/heads/main'
with:
platforms: linux/arm/v7,linux/amd64,linux/arm64/v8,linux/ppc64le,linux/s390x
push: true
context: .
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG }}
# this is used mainly for testing
- name: Build & push Docker image (amd64 + linux/arm64/v8 for develop)
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
if: github.ref == 'refs/heads/develop'
with:
platforms: linux/amd64,linux/arm64/v8
push: true
context: .
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_DEVELOP }}