forked from Alfresco/alfresco-docker-activemq
-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (82 loc) · 3.01 KB
/
build.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
80
81
82
83
84
85
86
87
88
89
90
91
name: Docker Build
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
env:
IMAGE_NAME: hmpps-delius-alfresco-activemq
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: Alfresco/alfresco-build-tools/.github/actions/pre-commit@v7.1.0
docker:
name: activemq ${{ matrix.activemq_base_version }}
strategy:
matrix:
base_image:
- flavor: rockylinux
major: 8
java_major:
- 17
jdist:
- jre
activemq_base_version:
- 5.16
- 5.17
- 5.18
env:
# Which activemq_base_version of the matrix should produce `latest` tag
ACTIVEMQ_LATEST_VERSION: 5.18
runs-on: ubuntu-latest
needs: pre-commit
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- id: vars
name: Compute vars
env:
ACTIVEMQ_BASE_VERSION: ${{ matrix.activemq_base_version }}
run: |
ACTIVEMQ_VERSION=$(jq -r .activemq_version versions/activemq-${ACTIVEMQ_BASE_VERSION}.json)
echo "activemq_version=$ACTIVEMQ_VERSION" >> $GITHUB_OUTPUT
echo "image_created=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_OUTPUT
GHCR_IMAGE_NAME="ghcr.io/${IMAGE_REGISTRY_NAMESPACE}/${IMAGE_REPOSITORY}"
TAG_COMMON_METADATA="${{ matrix.jdist }}${{ matrix.java_major }}-${{ matrix.base_image.flavor }}${{ matrix.base_image.major }}"
IMAGE_TAG_SEMVER="${ACTIVEMQ_VERSION}-${TAG_COMMON_METADATA}"
IMAGE_TAG_MINOR="${ACTIVEMQ_BASE_VERSION}-${TAG_COMMON_METADATA}"
echo "tags<<EOF" >> $GITHUB_OUTPUT
echo "ghcr.io/${{github.repository_owner }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG_SEMVER}" >> $GITHUB_OUTPUT
echo "ghcr.io/${{github.repository_owner }}/${{ env.IMAGE_NAME }}:${IMAGE_TAG_MINOR}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Log in to the Container registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.actor != 'dependabot[bot]' }}
build-args: |
ACTIVEMQ_VERSION=${{ steps.vars.outputs.activemq_version }}
JDIST=${{ matrix.jdist }}
DISTRIB_NAME=${{ matrix.base_image.flavor }}
DISTRIB_MAJOR=${{ matrix.base_image.major }}
JAVA_MAJOR=${{ matrix.java_major }}
REVISION=${{ github.run_number }}
CREATED=${{ steps.vars.outputs.image_created }}
tags: |
${{ steps.vars.outputs.tags }}
labels: |
${{ steps.vars.outputs.labels }}
provenance: false
target: ACTIVEMQ_IMAGE
platforms: linux/amd64,linux/arm64/v8