Skip to content

Cleanup kbs docs

Cleanup kbs docs #266

name: Build and Push CLI artifacts
on:
push:
branches:
- main
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
build_and_push:
name: Build and push ${{ matrix.component }} on ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
# kbs-client
- component: kbs-client
arch: x86_64
instance: ubuntu-24.04
dockerfile: kbs/docker/kbs-client/Dockerfile
output_path: kbs-client
repo: ghcr.io/confidential-containers/staged-images/kbs-client
- component: kbs-client
arch: s390x
instance: ubuntu-24.04-s390x
dockerfile: kbs/docker/kbs-client/Dockerfile
output_path: kbs-client
repo: ghcr.io/confidential-containers/staged-images/kbs-client
- component: kbs-client
arch: aarch64
instance: ubuntu-24.04-arm
dockerfile: kbs/docker/kbs-client/Dockerfile
output_path: kbs-client
repo: ghcr.io/confidential-containers/staged-images/kbs-client
# trustee-cli
- component: trustee-cli
arch: x86_64
instance: ubuntu-24.04
dockerfile: tools/trustee-cli/Dockerfile
output_path: ./usr/local/bin/trustee
repo: ghcr.io/confidential-containers/staged-images/trustee-cli
- component: trustee-cli
arch: s390x
instance: ubuntu-24.04-s390x
dockerfile: tools/trustee-cli/Dockerfile
output_path: ./usr/local/bin/trustee
repo: ghcr.io/confidential-containers/staged-images/trustee-cli
- component: trustee-cli
arch: aarch64
instance: ubuntu-24.04-arm
dockerfile: tools/trustee-cli/Dockerfile
output_path: ./usr/local/bin/trustee
repo: ghcr.io/confidential-containers/staged-images/trustee-cli
runs-on: ${{ matrix.instance }}
permissions:
contents: read
packages: write # push CLI artifacts to GHCR
steps:
- name: Install ORAS
uses: oras-project/setup-oras@1d808f7d7f6995cc68b7bf507bfe5c5446e1dc9d # v2.0.1
with:
version: 1.0.0
- name: Check out code
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0
- name: Log in to ghcr.io
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build ${{ matrix.component }}
env:
MATRIX_DOCKERFILE: ${{ matrix.dockerfile }}
run: |
docker buildx build -f "${MATRIX_DOCKERFILE}" \
--build-arg ARCH="$(uname -m)" --output ./ .
- name: Push ${{ matrix.component }} to ghcr.io
env:
MATRIX_REPO: ${{ matrix.repo }}
MATRIX_OUTPUT_PATH: ${{ matrix.output_path }}
MATRIX_COMPONENT: ${{ matrix.component }}
run: |
commit_sha="${GITHUB_SHA}"
arch="$(uname -m)"
repo="${MATRIX_REPO}"
artifact="${MATRIX_OUTPUT_PATH}"
if [ "${MATRIX_COMPONENT}" = 'kbs-client' ]; then
oras push \
"${repo}:sample_only-${commit_sha}-${arch},latest-${arch}" \
"${artifact}"
else
oras push \
"${repo}:${commit_sha}-${arch},latest-${arch}" \
"${artifact}"
fi
if [ "${arch}" = "x86_64" ]; then
oras push "${repo}:latest" "${artifact}"
fi