Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/actions/build-single-image/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build staged image (single arch)
description: Build (and optionally push) a single-arch staged image to GHCR.

inputs:
ghcr_token:
description: Token to login to ghcr.io
required: false
docker_file:
description: Path to Dockerfile
required: true
tag:
description: Image tag under ghcr.io/confidential-containers/staged-images
required: true
platform:
description: Optional build target platform (e.g. linux/amd64)
required: false
default: ""
context:
description: Build context directory
required: false
default: "."
build_args:
description: Extra build args string (e.g. --build-arg FOO=bar)
required: false
default: ""
push:
description: Whether to push the built image to GHCR
required: false
default: "false"

runs:
using: composite
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0

- name: Login to GHCR Container Registry
Comment thread
Xynnn007 marked this conversation as resolved.
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
if: inputs.push == 'true'
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ inputs.ghcr_token }}

Comment thread
Xynnn007 marked this conversation as resolved.
- name: Build image
shell: bash
run: |
set -euo pipefail
commit_sha="${GITHUB_SHA}"
platform_args=()
if [ -n "${{ inputs.platform }}" ]; then
platform_args+=(--platform "${{ inputs.platform }}")
fi

# Parse build args into array to avoid shell injection.
build_args_array=()
if [ -n "${{ inputs.build_args }}" ]; then
read -r -a build_args_array <<< "${{ inputs.build_args }}"
fi
build_option_args=()
if [ "${{ inputs.push }}" = "true" ]; then
build_option_args+=(--push)
fi
docker buildx build --provenance false \
"${platform_args[@]}" \
-f "${{ inputs.docker_file }}" \
"${build_option_args[@]}" \
"${build_args_array[@]}" \
-t "ghcr.io/confidential-containers/staged-images/${{ inputs.tag }}:${commit_sha}-$(uname -m)" \
-t "ghcr.io/confidential-containers/staged-images/${{ inputs.tag }}:latest-$(uname -m)" \
"${{ inputs.context }}"
22 changes: 0 additions & 22 deletions .github/workflows/as-docker-build.yml

This file was deleted.

73 changes: 0 additions & 73 deletions .github/workflows/as-e2e.yml

This file was deleted.

82 changes: 0 additions & 82 deletions .github/workflows/as-rust.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/build-and-push-staged-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Staged Images

on:
pull_request:
branches: ["main"]
paths-ignore:
- '**/*.md'
push:
branches:
- main

permissions: {}

jobs:
build_staged_images_pr:
name: Build staged images (all) [PR]
if: github.event_name == 'pull_request'
permissions:
contents: read
uses: ./.github/workflows/workflow-call-build-staged-images.yml
with:
image_group: all
push: false

build_staged_images_push:
name: Build staged images (all) [push]
if: github.event_name == 'push'
permissions:
packages: write
contents: read
uses: ./.github/workflows/workflow-call-build-staged-images.yml
with:
image_group: all
push: true
secrets:
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Comment thread
Xynnn007 marked this conversation as resolved.
publish_manifests:
name: Publish multi-arch manifests
needs: build_staged_images_push
if: github.event_name == 'push'
permissions:
packages: write
contents: read
uses: ./.github/workflows/workflow-call-publish-staged-manifests.yml
with:
tags: '["kbs","kbs-grpc-as","coco-as-grpc","coco-as-restful","rvps","kbs-client-image"]'
secrets:
GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
90 changes: 0 additions & 90 deletions .github/workflows/build-as-image.yml

This file was deleted.

Loading
Loading