-
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (66 loc) · 2.22 KB
/
Copy pathci.yaml
File metadata and controls
75 lines (66 loc) · 2.22 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
---
name: ci
on:
workflow_dispatch:
push:
branches:
- main
paths: &ci_paths
- "docker-bake.hcl"
- "**/Dockerfile*"
- ".github/workflows/ci.yaml"
pull_request:
types: [opened, synchronize, reopened]
paths: *ci_paths
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.generate.outputs.matrix }}
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
- id: generate
uses: docker/bake-action/subaction/matrix@3acf805d94d93a86cce4ca44798a76464a75b88c # v6
build:
runs-on: ubuntu-latest
needs:
- prepare
strategy:
fail-fast: false
matrix:
include: ${{ fromJson(needs.prepare.outputs.matrix) }}
permissions:
contents: read
packages: write
steps:
- name: set up qemu
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3
- name: set up docker buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3
- name: generate docker metadata
id: docker-meta
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5
- name: generate github metadata
id: github-meta
uses: dockerbakery/github-metadata-action@eb086bf6c4b697df69a9135a2250e1a2214f0cc0 # v3.0
- name: login to docker hub
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3
with:
username: ${{ secrets.DOCKER_REGISTRY_USERNAME }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
- name: build and push
uses: docker/bake-action@3acf805d94d93a86cce4ca44798a76464a75b88c # v6
with:
targets: ${{ matrix.target }}
push: ${{ github.event_name != 'pull_request' }}
files: |
./docker-bake.hcl
cwd://${{ steps.docker-meta.outputs.bake-file-labels }}
cwd://${{ steps.docker-meta.outputs.bake-file-annotations }}
cwd://${{ steps.github-meta.outputs.bake-file }}
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max