-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (68 loc) · 2.03 KB
/
build.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
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
name: Build
on:
schedule:
- cron: "0 5 * * 1"
workflow_call:
workflow_dispatch:
permissions:
contents: read
packages: write
jobs:
build-image:
name: Build images and push to registry
runs-on: ubuntu-24.04
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Create new buildx builder
uses: docker/setup-buildx-action@v3
- name: Generate app image tags
uses: docker/metadata-action@v5
id: meta-app
with:
bake-target: app-production
images: |
ghcr.io/${{ github.repository }}-app
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Generate web image tags
uses: docker/metadata-action@v5
id: meta-web
with:
bake-target: web-production
images: |
ghcr.io/${{ github.repository }}-web
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Generate grafana image tags
uses: docker/metadata-action@v5
id: meta-grafana
with:
bake-target: grafana-production
images: |
ghcr.io/${{ github.repository }}-grafana
tags: |
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/[email protected]
with:
files: |
./docker-bake.hcl
${{ steps.meta-app.outputs.bake-file }}
${{ steps.meta-web.outputs.bake-file }}
${{ steps.meta-grafana.outputs.bake-file }}
set: |
*.cache-to=type=gha,mode=max
*.cache-from=type=gha
push: true