Skip to content

Build 1/merge

Build 1/merge #16

Workflow file for this run

name: build
run-name: Build ${{ github.ref_name }}
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
paths:
- '**.go'
- 'Dockerfile'
- 'Makefile'
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
name=docker.io/demeesterdev/cert-manager-webhook-transip,enable=${{ github.event_name != 'pull_request' }}
name=ghcr.io/demeesterdev/cert-manager-webhook-transip
tags: |
type=ref,event=branch,enable=${{ github.event_name != 'pull_request' }}
type=ref,event=pr,enable=${{ github.event_name == 'pull_request' }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: gha
cache-to: gha