-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathaction.yml
More file actions
57 lines (53 loc) · 1.88 KB
/
action.yml
File metadata and controls
57 lines (53 loc) · 1.88 KB
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
name: Docker Build
description: Builds linkerd's docker images
inputs:
docker-registry:
description: The docker registry used to tag the images
required: false
default: cr.l5d.io/linkerd
docker-target:
description: The OS-arch the docker build will be targeted to
required: false
default: linux-amd64
docker-push:
description: Whether to push the built images to the registry
required: false
default: ''
component:
description: Component to build
required: true
tag:
description: Tag to use for the built image
required: true
runs:
using: composite
steps:
# populate ACTIONS_CACHE_URL and ACTIONS_RUNTIME_TOKEN
- uses: crazy-max/ghaction-github-runtime@04d248b84655b509d8c44dc1d6f990c879747487
- uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a
- uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f
with:
driver-opts: network=host
- env:
DOCKER_REGISTRY: ${{ inputs.docker-registry }}
DOCKER_TARGET: ${{ inputs.docker-target }}
DOCKER_PUSH: ${{ inputs.docker-push }}
TAG: ${{ inputs.tag }}
RUNTIME_IMAGE: localhost:5000/linkerd/proxy-runtime:${{ inputs.tag }}
PUSH_RUNTIME_IMAGE: true
shell: bash
run: bin/docker-build-${{ inputs.component }}
- name: Output Image Digest
shell: bash
id: image_digest
run: |
image_digest=$(cat target/metadata-${{ inputs.component }}.json | jq -r '."containerimage.digest"')
echo "${image_digest}"
echo "DIGEST=${{ inputs.docker-registry }}/${{ inputs.component }}@${image_digest}" >> "$GITHUB_OUTPUT"
outputs:
image:
description: The image that was built
value: ${{ inputs.docker-registry }}/${{ inputs.component }}:${{ inputs.tag }}
digest:
description: The image digest
value: ${{ steps.image_digest.outputs.DIGEST }}