-
Notifications
You must be signed in to change notification settings - Fork 90
76 lines (70 loc) · 2.39 KB
/
build-as-image.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
74
75
76
name: Build CoCo AS/RVPS Image
on:
workflow_call:
inputs:
build_option:
description: 'Build option for the image'
type: string
required: false
jobs:
build_as_image:
strategy:
fail-fast: false
matrix:
target_arch:
- x86_64
- s390x
- aarch64
name:
- RESTful CoCo-AS
- gRPC CoCo-AS
- RVPS
include:
# add docker_file + tag to each target
- name: gRPC CoCo-AS
docker_file: attestation-service/docker/as-grpc/Dockerfile
tag: coco-as-grpc
- name: RESTful CoCo-AS
docker_file: attestation-service/docker/as-restful/Dockerfile
tag: coco-as-restful
- name: RVPS
docker_file: rvps/docker/Dockerfile
tag: rvps
# add instance and verifier flag to target
- target_arch: x86_64
target_platform: linux/amd64
build_platform: linux/amd64
instance: ubuntu-latest
verifier: all-verifier
- target_arch: s390x
target_platform: linux/s390x
build_platform: linux/s390x
instance: s390x
verifier: se-verifier
- target_arch: aarch64
target_platform: linux/arm64
build_platform: linux/amd64
instance: ubuntu-latest
verifier: cca-verifier
runs-on: ${{ matrix.instance }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GHCR Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{ matrix.name }} Container Image
run: |
commit_sha=${{ github.sha }}
docker buildx build --platform "${{ matrix.target_platform }}" --provenance false \
-f "${{ matrix.docker_file }}" ${{ inputs.build_option }} \
--build-arg BUILDPLATFORM="${{ matrix.build_platform }}" \
--build-arg ARCH="${{ matrix.target_arch }}" \
--build-arg VERIFIER="${{ matrix.verifier }}" \
-t "ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:${commit_sha}-${{ matrix.target_arch }}" \
-t "ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:latest-${{ matrix.target_arch }}" .