-
Notifications
You must be signed in to change notification settings - Fork 137
/
action.yaml
53 lines (52 loc) · 1.85 KB
/
action.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
name: Build Docker Image
description: Builds the operator docker image
inputs:
platform:
description: The platform for which the image will be built
required: true
labels:
description: The labels for the built image
required: true
image-tag:
description: The tag of the built image
required: true
runs:
using: "composite"
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
- name: Set up Golang
uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 # v5.0.1
with:
go-version-file: "${{ github.workspace }}/go.mod"
- name: Prepare build parameters
id: prep
shell: bash
run: |
hack/build/ci/prepare-build-variables.sh
- name: Download third party licenses
shell: bash
run: |
hack/build/ci/third-party-licenses.sh
- name: Build target
uses: docker/build-push-action@94f8f8c2eec4bc3f1d78c1755580779804cb87b2 # v6.0.1
with:
builder: ${{ steps.buildx.outputs.name }}
build-args: |
GO_LINKER_ARGS=${{ steps.prep.outputs.go_linker_args }}
GO_BUILD_TAGS=${{ steps.prep.outputs.go_build_tags }}
context: .
file: ./Dockerfile
platforms: linux/${{ inputs.platform }}
push: false
tags: operator-${{ inputs.platform }}:${{ inputs.image-tag }}
labels: ${{ inputs.labels }}
outputs: type=docker,dest=/tmp/operator-${{ inputs.platform }}.tar
- name: Upload artifact
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: operator-${{ inputs.platform }}
path: /tmp/operator-${{ inputs.platform }}.tar
retention-days: 1