-
Notifications
You must be signed in to change notification settings - Fork 18
76 lines (67 loc) · 2.27 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
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
### This workflow setup instance then build and push images ###
name: Multi-arch build
on:
push:
tags:
- "v*"
jobs:
prepare-build:
name: "Prepare build"
runs-on: ubuntu-latest
outputs:
sourceTag: ${{ steps.prepare.outputs.sourceTag }}
dsHash: ${{ steps.prepare.outputs.dsHash }}
steps:
- name: prepare-build
id: prepare
run: |
echo "sourceTag=${GITHUB_REF#refs/tags/}" >> "$GITHUB_OUTPUT"
echo "dsHash=$(echo -n "$(date +'%Y.%m.%d-%H%M')" | md5sum | awk '{print $1}')" >> "$GITHUB_OUTPUT"
build:
name: "${{ matrix.name }} ${{ matrix.edition }}"
runs-on: ubuntu-latest
needs: [prepare-build]
strategy:
fail-fast: false
matrix:
name: ["Build Docs"]
dockerfile: ["Dockerfile"]
edition: [ "", "-ee", "-de"]
images: [ "proxy docservice converter" ]
include:
- edition: "-de"
name: "Build Docs non-plugins"
dockerfile: "Dockerfile.noplugins"
images: "proxy docservice converter"
postfix: "-noplugins"
- edition: ""
name: "Build utils"
dockerfile: "Dockerfile"
images: "example utils"
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: "Build Docs${{ matrix.edition }}"
env:
DS_VERSION_HASH: ${{ needs.prepare-build.outputs.dsHash }}
SOURCE_TAG: ${{ needs.prepare-build.outputs.sourceTag }}
NOPLUG_POSTFIX: ${{ matrix.postfix }}
DOCKERFILE: ${{ matrix.dockerfile }}
run: |
: ${DS_VERSION_HASH:?Should be set!}
DS_VERSION_HASH=${DS_VERSION_HASH} \
DOCKER_TAG=$(echo ${SOURCE_TAG} | sed 's/^.//') \
PRODUCT_EDITION=${{ matrix.edition }} \
TAG=$DOCKER_TAG \
docker buildx bake \
-f docker-bake.hcl ${{ matrix.images }} \
--push