-
Notifications
You must be signed in to change notification settings - Fork 17
69 lines (65 loc) · 1.76 KB
/
docker.yml
File metadata and controls
69 lines (65 loc) · 1.76 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
name: Docker Build
on:
push:
branches:
- trunk
tags:
- "*"
env:
DOCKER_REGISTRY: registry.dreamlab.gg
DOCKER_USERNAME: ci
permissions:
contents: read
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Generate matrix
id: generate
uses: docker/bake-action/subaction/matrix@v6
build:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
env:
DOCKER_BUILD_RECORD_UPLOAD: "false"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: ${{ env.DOCKER_REGISTRY }}
username: ${{ env.DOCKER_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Extract Metadata
uses: docker/metadata-action@v5
id: meta
with:
images: ${{ env.DOCKER_REGISTRY }}/${{ matrix.target }}
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,prefix=
type=sha,format=long,prefix=
type=raw,value=latest,enable={{ is_default_branch }}
- name: Build
uses: docker/bake-action@v6
with:
files: |
./docker-bake.hcl
cwd://${{ steps.meta.outputs.bake-file }}
targets: ${{ matrix.target }}
push: ${{ startsWith(github.ref, 'refs/tags/') }}