-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (62 loc) · 1.73 KB
/
release.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
60
61
62
63
64
65
name: release
on:
workflow_dispatch:
inputs:
name:
description: 'Image name'
required: true
type: choice
options:
- kine
- zig
version:
description: 'Version'
required: true
type: string
push:
description: 'Push'
type: boolean
default: false
registry:
description: 'Registry'
type: string
default: 'ghcr.io'
repository:
description: 'Repository'
type: string
default: 'anza-labs/library'
permissions:
contents: write
packages: write
jobs:
image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/login-action@v3
with:
registry: ${{ inputs.registry }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- id: meta
uses: docker/metadata-action@v5
with:
images: |
name=${{ inputs.registry }}/${{ inputs.repository }}/${{ inputs.name }},enable=true
tags: |
type=semver,pattern={{version}},value=${{ inputs.version }}
type=semver,pattern={{major}}.{{minor}},value=${{ inputs.version }}
- run: |
echo "variable \"${{ inputs.name }}\" { default = \"${{ inputs.version }}\" }" > ./vars.hcl
- id: buildx
uses: docker/setup-buildx-action@v3
- uses: docker/bake-action@v6
with:
builder: ${{ steps.buildx.outputs.name }}
push: ${{ inputs.push }}
files: |
./docker-bake.hcl
cwd://${{ steps.meta.outputs.bake-file }}
cwd://vars.hcl
targets: ${{ inputs.name }}