This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build CoCo AS/RVPS Image | |
on: | |
workflow_call: | |
inputs: | |
build_option: | |
description: 'Build option for the image' | |
type: string | |
required: false | |
push: | |
branches: | |
- mkulke/consolidate-matrix-configurations | |
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}" . |