-
Notifications
You must be signed in to change notification settings - Fork 22
60 lines (50 loc) · 1.7 KB
/
build-dev.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
54
55
56
57
58
59
name: build and publish container
on:
push:
jobs:
build-container:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Checkout
uses: actions/checkout@v2
- name: Login to GHCR
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '^1.17'
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: capi-nutanix
sep-tags: ","
sep-labels: ","
tags: |
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
type=semver,pattern=v{{major}}
type=sha
- name: Install tools
uses: redhat-actions/openshift-tools-installer@v1
with:
source: "github"
ko: "latest"
- name: Prepare build
run: make test
- name: Build container
env:
KO_DOCKER_REPO: ghcr.io/nutanix-cloud-native/cluster-api-provider-nutanix/controller
TAGS: ${{ steps.meta.outputs.tags }}
LABELS: ${{ steps.meta.outputs.labels }}
PLATFORMS: linux/amd64,linux/arm64,linux/arm
run: |
PTAGS=`echo $TAGS | sed 's/capi-nutanix://g'`
export SOURCE_DATE_EPOCH=$(date +%s)
ko build --bare --image-label "$LABELS" -t "$PTAGS" --platform=$PLATFORMS .