Skip to content

Commit

Permalink
kbs: Build image on merge to main
Browse files Browse the repository at this point in the history
Fixes: #167
Signed-off-by: Kartik Joshi <[email protected]>
  • Loading branch information
kartikjoshi21 committed Nov 7, 2023
1 parent e596dfe commit 06ed40f
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/kbs_build_and_push.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Build and Push kbs Image

on:
push:
branches:
- main
- kartikjoshi21/kbs-image

jobs:
build_and_push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Get Commit SHA
id: commit_sha
run: echo "::set-output name=sha::$(git rev-parse --short ${{ github.sha }})"

- name: Login to GHCR Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ secrets.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Build Container Image
run: |
commit_sha=${{ steps.commit_sha.outputs.sha }}
DOCKER_BUILDKIT=1 docker build -t ghcr.io/confidential-containers/staged-images:kbs-commit-${commit_sha} --build-arg KBS_FEATURES=coco-as-builtin,openssl,resource,opa . -f docker/Dockerfile --push

0 comments on commit 06ed40f

Please sign in to comment.