-
-
Notifications
You must be signed in to change notification settings - Fork 14
79 lines (73 loc) · 2.3 KB
/
docker-build-mysql.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
77
78
79
# yaml-language-server: $schema=https://json.schemastore.org/github-workflow
---
name: "MySQL • Docker Build"
on:
schedule:
- cron: "0 1 * * 6"
workflow_dispatch:
push:
paths:
- images/.trigger
- images/mysql/**
branches:
- main
jobs:
build:
name: "Build mysql"
runs-on: ubuntu-latest
strategy:
matrix:
include:
- BUILD_TAG: "latest"
IMAGE_TAG: "8.3"
PLATFORMS: "linux/amd64,linux/arm64"
- BUILD_TAG: "8.3"
IMAGE_TAG: "8.3"
PLATFORMS: "linux/amd64,linux/arm64"
- BUILD_TAG: "8.0"
IMAGE_TAG: "8.0"
PLATFORMS: "linux/amd64,linux/arm64"
- BUILD_TAG: "5.7"
IMAGE_TAG: "5.7"
PLATFORMS: "linux/amd64"
- BUILD_TAG: "5.6"
IMAGE_TAG: "5.6"
PLATFORMS: "linux/amd64"
steps:
- uses: actions/checkout@v4
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
image: mirror.gcr.io/tonistiigi/binfmt:latest
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
driver-opts: image=moby/buildkit:master
config-inline: |
[registry."docker.io"]
mirrors = ["${{ secrets.DOCKER_PROXY }}"]
- uses: supplypike/setup-bin@v4
with:
uri: https://github.com/hairyhenderson/gomplate/releases/latest/download/gomplate_linux-amd64
name: gomplate
version: latest
- name: Generate Dockerfile
run: gomplate -f images/mysql/tpl.Dockerfile -o images/mysql/Dockerfile
env:
IMAGE_TAG: ${{ matrix.IMAGE_TAG }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: images/mysql/context
file: images/mysql/Dockerfile
push: true
platforms: ${{ matrix.PLATFORMS }}
tags: ${{ vars.DOCKER_REPO }}/mysql:${{ matrix.BUILD_TAG }}
cache-from: type=registry,ref=${{ vars.DOCKER_REPO }}/mysql:${{ matrix.BUILD_TAG }}
cache-to: type=inline