forked from kcp-dev/kcp
-
Notifications
You must be signed in to change notification settings - Fork 0
53 lines (46 loc) · 1.4 KB
/
kcp-image.yaml
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
50
51
52
53
name: Build and Publish KCP Image
permissions:
packages: write
on:
push:
branches:
- main
- 'release-*'
tags:
- 'v*'
jobs:
build:
if: github.repository_owner == 'kcp-dev'
name: Build KCP Image
runs-on: ubuntu-latest
outputs:
sha_short: ${{ steps.vars.outputs.sha_short }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
with:
go-version: v1.18
- name: Get the short sha
id: vars
run: echo "::set-output name=sha_short::$(echo ${{ github.sha }} | cut -b -7)"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
# 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 ${{ steps.vars.outputs.sha_short }} ${{ github.ref_name }}
archs: amd64, ppc64le, arm64
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 }} ${{ github.ref_name }}
registry: ghcr.io/${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ github.token }}