Skip to content

Commit

Permalink
Add workflow to build kcp image
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Sams <[email protected]>
  • Loading branch information
csams committed Feb 7, 2022
1 parent 5062f6a commit e30b8bc
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/kcp-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Build and Publish KCP Image

permissions:
packages: write

on:
workflow_run:
workflows: [ "CI" ]
branches: [ "main" ]
types:
- completed

jobs:
kcp-image:
if: ${{ github.event.workflow_run.conclusion == "success" && github.event_name == "push" }}
name: Build and Publish KCP Image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: v1.17

# Build and push a KCP image, tagged with latest and the commit SHA.
- name: Build KCP Image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: kcp
tags: latest ${{ github.sha }}
containerfiles: |
./Dockerfile
- name: Push to ghcr.io
id: push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}

16 changes: 15 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# Build the manager binary
# Copyright 2022 The KCP Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Build the binary
FROM registry.access.redhat.com/ubi8/go-toolset:1.16.12-4 as builder

WORKDIR /workspace
Expand Down

0 comments on commit e30b8bc

Please sign in to comment.