forked from confidential-containers/cloud-api-adaptor
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (75 loc) · 2.59 KB
/
peerpod-ctrl_image.yaml
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
74
75
76
77
78
# Copyright Confidential Containers Contributors
# SPDX-License-Identifier: Apache-2.0
#
# Push peerpod-ctrl image
---
name: (Callable) Build and push peerpod-ctrl image
on:
workflow_call:
inputs:
registry:
default: 'quay.io/confidential-containers'
description: 'Image registry (e.g. "ghcr.io/confidential-containers") where the built image will be pushed to'
required: false
type: string
image_tags:
description: 'Comma-separated list of tags for the dev built image (e.g. latest,ci-dev). By default uses the values from hack/build.sh'
required: true
type: string
git_ref:
default: 'main'
description: Git ref to checkout the cloud-api-adaptor repository. Defaults to main.
required: false
type: string
jobs:
peerpod_push:
name: build and push peerpod-ctrl
runs-on: ubuntu-24.04
defaults:
run:
working-directory: src/peerpod-ctrl
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ inputs.git_ref }}"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Quay container Registry
if: ${{ startsWith(inputs.registry, 'quay.io') }}
uses: docker/login-action@v3
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Login to Github Container Registry
if: ${{ startsWith(inputs.registry, 'ghcr.io') }}
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Validate build args contains the essentials
run: |
make list-build-args | grep -e 'CGO_ENABLED=[0|1]' && \
make list-build-args | grep 'GOFLAGS=' | grep -E '\-tags=[a-z,]*'
- name: Determine tags
id: tags
run: |
tags="${{ inputs.image_tags }}"
tags_new=""
for t in ${tags/,/ }; do
tags_new+="${{ inputs.registry }}/peerpod-ctrl:${t},"
done
echo "tags=${tags_new}" >> "$GITHUB_OUTPUT"
- name: Build and push
uses: docker/build-push-action@v6
with:
tags: ${{ steps.tags.outputs.tags }}
push: true
context: src
file: src/peerpod-ctrl/Dockerfile
platforms: linux/amd64, linux/s390x, linux/ppc64le
build-args: |
GOFLAGS=-tags=aws,azure,ibmcloud,vsphere,libvirt