-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (40 loc) · 1.68 KB
/
build.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
name: Build
on:
push:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
Build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@c47758b77c9736f4b2ef4073d4d51994fabfe349 # v3
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_TOKEN }}
#extract the version from the Dockerfile to match the FROM bitnami/mariadb:11.2.4-debian-12-r42@SHA... -> 11.2.4-debian-12-r42
- name: Extract version
id: extract_version
run: echo img_version=$(grep -oP 'FROM bitnami/mariadb:\K[^@\s]+' Dockerfile) >> $GITHUB_ENV
- name: Build
uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6
with:
#only push for main branch
push: ${{ github.ref == 'refs/heads/main' }}
platforms: ${{ github.ref == 'refs/heads/main' && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
labels: |
org.opencontainers.image.title=Voxmeter MariaDB
org.opencontainers.image.description=Voxmeter MariaDB
org.opencontainers.image.vendor=Voxmeter A/S
org.opencontainers.image.licenses=MIT
tags: |
${{ secrets.DOCKER_USERNAME }}/mariadb:${{ env.img_version }}