forked from linkerd/linkerd2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
50 lines (47 loc) · 1.71 KB
/
action.yml
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
name: Rust Image Build
description: Builds linkerd's rust images
inputs:
docker-ghcr-username:
description: GH username under which to push images
required: true
docker-ghcr-pat:
description: GH PAT for docker-ghcr-username
required: true
component:
description: Image to build
required: true
component-path:
description: Path to component
required: true
arch:
description: Target architecture
required: true
tag:
description: Docker image tag
required: true
runs:
using: composite
steps:
- uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6
- uses: actions/cache@c3f1317a9e7b1ef106c153ac8c0f00fed3ddbc0d
with:
path: ${{ runner.temp }}/.buildx-cache
key: ${{ inputs.component }}-${{ inputs.arch }}-${{ inputs.tag }}
restore-keys: ${{ inputs.component }}-
- uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b
with:
registry: ghcr.io
username: ${{ inputs.docker-ghcr-username }}
password: ${{ inputs.docker-ghcr-pat }}
- name: Build and push ${{ inputs.component }} ${{ inputs.arch }}
shell: bash
run: |
docker buildx build --push . \
-f ./${{ inputs.component-path }}/${{ inputs.arch }}.dockerfile \
--tag=ghcr.io/${{ github.repository_owner }}/${{ inputs.component }}:${{ inputs.tag }}-${{ inputs.arch }} \
--cache-from type=local,src=${{ runner.temp }}/.buildx-cache \
--cache-to type=local,dest=${{ runner.temp }}/.buildx-cache,mode=max
outputs:
image:
description: The image that was built
value: ghcr.io/${{ github.repository_owner }}/${{ inputs.component }}:${{ inputs.tag }}-${{ inputs.arch }}