-
Notifications
You must be signed in to change notification settings - Fork 88
62 lines (56 loc) · 1.82 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
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:
instance:
- ubuntu-latest
- s390x
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 verifier flag to arch
- instance: ubuntu-latest
verifier: all-verifier
- instance: s390x
verifier: se-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 }}
arch=$(uname -m)
DOCKER_BUILDKIT=1 docker build -f "${{ matrix.docker_file }}" ${{ inputs.build_option }} --build-arg ARCH="${arch}" \
--build-arg VERIFIER="${{ matrix.verifier }}" \
-t "ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:${commit_sha}-${arch}" \
-t "ghcr.io/confidential-containers/staged-images/${{ matrix.tag }}:latest-${arch}" .