forked from bersler/OpenLogReplicator
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (61 loc) · 1.98 KB
/
Copy pathrelease.yaml
File metadata and controls
68 lines (61 loc) · 1.98 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
name: Release Build
on:
push:
branches: [master]
paths: [CMakeLists.txt]
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
packages: write
env:
IMAGE: ghcr.io/${{ github.repository }}
steps:
- uses: actions/checkout@v4
- name: Extract version and short SHA
id: version
run: |
VERSION=$(grep -oP 'VERSION \K[0-9]+(\.[0-9]+)+' CMakeLists.txt | head -1)
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "short_sha=${GITHUB_SHA::8}" >> "$GITHUB_OUTPUT"
echo "IMAGE=${IMAGE,,}" >> "$GITHUB_ENV"
- name: Check if image already exists
id: check
run: |
if docker manifest inspect "${IMAGE}:${VERSION}" > /dev/null 2>&1; then
echo "exists=true" >> "$GITHUB_OUTPUT"
echo "Image ${IMAGE}:${VERSION} already exists, skipping build"
else
echo "exists=false" >> "$GITHUB_OUTPUT"
fi
env:
DOCKER_CLI_EXPERIMENTAL: enabled
VERSION: ${{ steps.version.outputs.version }}
- uses: docker/setup-buildx-action@v3
if: steps.check.outputs.exists != 'true'
- name: Log in to ghcr.io
if: steps.check.outputs.exists != 'true'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push release image
if: steps.check.outputs.exists != 'true'
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.release
push: true
tags: ${{ env.IMAGE }}:${{ steps.version.outputs.version }}
build-args: |
GIT_SHORT_SHA=${{ steps.version.outputs.short_sha }}
UIDOLR=1001
GIDOLR=1001
GIDORA=54322
WITHORACLE=1
WITHKAFKA=1
WITHPROTOBUF=1
WITHPROMETHEUS=1