-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (59 loc) · 2.19 KB
/
cd.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 2024 Dotanuki Labs
# SPDX-License-Identifier: MIT
name: CD
on:
push:
branches:
- main
permissions:
packages: write
contents: read
jobs:
build-docker-images:
runs-on: ${{ matrix.runner }}
strategy:
matrix:
runner: ["ubuntu22-amd64-medium", "ubuntu22-arm64-medium"]
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Prepare build environment
id: docker-env
run: ./docker-build-helper.sh prepare-environment
- name: Docker metadata
id: docker-metadata
uses: docker/metadata-action@369eb591f429131d6889c46b94e711f089e6ca96 # v5
with:
images: ghcr.io/${{ github.repository }}
- name: Set up docker-buildx
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
- name: Log in to Github Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container Image
id: build
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
with:
push: true
provenance: false
platforms: linux/${{ steps.docker-env.outputs.platform }}
labels: ${{ steps.docker-metadata.outputs.labels }}
outputs: type=registry,push=true
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-${{ steps.docker-env.outputs.platform }}
merge-manifests:
runs-on: ubuntu-24.04
needs: build-docker-images
steps:
- name: Project Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Log in to Github Container Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create and push merged manifest
run: ./docker-build-helper.sh push-merged-manifest ${{ github.sha }}