-
Notifications
You must be signed in to change notification settings - Fork 91
49 lines (42 loc) · 1.3 KB
/
push-kbs-client-to-ghcr.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
name: Build and Push kbs-client
on:
push:
branches:
- main
jobs:
build_and_push:
strategy:
fail-fast: false
matrix:
arch:
- x86_64
- s390x
- aarch64
runs-on: ${{ matrix.arch == 's390x' && 's390x' || 'ubuntu-22.04' }}
permissions:
contents: read
packages: write
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build a statically linked kbs-client for ${{ matrix.arch }} linux
run: |
docker buildx build -f kbs/docker/kbs-client/Dockerfile \
--build-arg ARCH="${{ matrix.arch }}" --output ./ .
- name: Push to ghcr.io
run: |
commit_sha=${{ github.sha }}
oras push \
ghcr.io/confidential-containers/staged-images/kbs-client:sample_only-${{ matrix.arch }}-linux-gnu-${commit_sha},latest-${{ matrix.arch }} \
kbs-client
if [ "${{ matrix.arch }}" = "x86_64" ]; then
oras push ghcr.io/confidential-containers/staged-images/kbs-client:latest kbs-client
fi