-
Notifications
You must be signed in to change notification settings - Fork 10
80 lines (69 loc) · 2.15 KB
/
publish-image.yaml
File metadata and controls
80 lines (69 loc) · 2.15 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# SPDX-FileCopyrightText: 2023 bootloose authors
# SPDX-License-Identifier: Apache-2.0
name: Publish Image
on:
workflow_call:
inputs:
image:
type: string
description: The image to be published.
tag:
type: string
description: The tag to use for the image. Defaults to :latest if not specified.
required: false
default: latest
secrets:
QUAY_USERNAME:
description: The username used to log in to Quay.io.
required: true
QUAY_PASSWORD:
description: The password used to log in to Quay.io.
required: true
workflow_dispatch:
inputs:
image:
type: string
description: The image to be published.
tag:
type: string
description: The tag to use for the image. Defaults to :latest if not specified.
required: false
default: latest
jobs:
publish_image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: List image platforms
id: list-platforms
run: |
platforms=$(make -s -C images "${{ inputs.image }}-platforms")
echo "platforms=${platforms}" >> $GITHUB_OUTPUT
- name: Login to Quay
uses: docker/login-action@v4
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
registry: quay.io
- name: Set up QEMU
uses: docker/setup-qemu-action@v4
with:
platforms: ${{ steps.list-platforms.outputs.platforms }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Cache Buildx Docker layers
uses: actions/cache@v5
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx
- name: Build ${{ inputs.image }}
uses: docker/build-push-action@v7
with:
platforms: ${{ steps.list-platforms.outputs.platforms }}
push: true
tags: |
quay.io/k0sproject/bootloose-${{ inputs.image }}:${{ inputs.tag }}
context: images/${{ inputs.image }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache