-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (55 loc) · 1.54 KB
/
ci.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
---
name: CI
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
version: [13, 14, 15, 16, 17, 18]
include:
- version: 13
alpine_tag: 3.18
- version: 14
alpine_tag: 3.18
- version: 15
alpine_tag: 3.18
- version: 16
alpine_tag: latest
- version: 17
alpine_tag: latest
- version: 18
alpine_tag: latest
steps:
- name: Prepare
id: prep
run: |
if [[ ${GITHUB_REF##*/} == "main" ]]; then
echo push=true >> $GITHUB_OUTPUT
else
echo push=false >> $GITHUB_OUTPUT
fi
echo "created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}
- name: Build docker image
uses: docker/build-push-action@v5
with:
build-args: |
VERSION=${{ matrix.version }}
ALPINE_TAG=${{ matrix.alpine_tag }}
push: ${{ steps.prep.outputs.push }}
tags: ${{ secrets.DOCKER_HUB_USER }}/clang-format:${{ matrix.version }}
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.prep.outputs.created }}