-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (44 loc) · 1.66 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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.28
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@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ env.USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@6524bf65af31da8d45b59e8c27de4bd072b392f5 # v3.8.0
- name: Build & push Docker image (all architectures)
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.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 only for develop)
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
if: github.ref == 'refs/heads/develop'
with:
platforms: linux/amd64
push: true
context: .
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.IMAGE_TAG_DEVELOP }}