Skip to content

Commit

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

on:
push:
branches:
- 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: Cache Docker layers
uses: actions/cache@v2
with:
path: |
~/.cache
key: ${{ runner.os }}-docker-${{ hashFiles('**/Dockerfile') }}
if: runner.os == 'Linux'

- name: Login to quay Container Registry
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Build Container Image
run: |
commit_sha=${{ steps.commit_sha.outputs.sha }}
DOCKER_BUILDKIT=1 docker build -t quay.io/karikjoshi21/kbs:coco-as-${commit_sha} . -f docker/Dockerfile --push; \
DOCKER_BUILDKIT=1 docker build -t quay.io/karikjoshi21/kbs:coco-as-openssl-${commit_sha} --build-arg KBS_FEATURES=coco-as-builtin,openssl,resource,opa . -f docker/Dockerfile --push; \
DOCKER_BUILDKIT=1 docker build -t quay.io/karikjoshi21/kbs:coco-as-grpc-${commit_sha} . -f docker/Dockerfile.coco-as-grpc --push

0 comments on commit 21705eb

Please sign in to comment.