-
Notifications
You must be signed in to change notification settings - Fork 57
84 lines (81 loc) · 2.45 KB
/
coordinator-build-and-publish.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
name: coordinator-build
on:
workflow_call:
inputs:
commit_tag:
required: true
type: string
last_commit_tag:
required: true
type: string
common_ancestor_tag:
required: true
type: string
develop_tag:
required: true
type: string
untested_tag_suffix:
required: true
type: string
image_name:
required: true
type: string
secrets:
DOCKERHUB_USERNAME:
required: true
DOCKERHUB_TOKEN:
required: true
concurrency:
group: coordinator-build-and-publish-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref_name != 'main' }}
jobs:
build-and-publish:
runs-on: ubuntu-22.04
name: Coordinator build
environment: ''
env:
COMMIT_TAG: ${{ inputs.commit_tag }}
DEVELOP_TAG: ${{ inputs.develop_tag }}
UNTESTED_TAG_SUFFIX: ${{ inputs.untested_tag_suffix }}
IMAGE_NAME: ${{ inputs.image_name }}
GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN_RELEASE_ACCESS }}
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: Build dist
run: |
./gradlew coordinator:app:distZip --no-daemon
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: coordinator
uses: docker/metadata-action@v3
with:
images: ${{ env.IMAGE_NAME }}
- name: Build & push
uses: docker/build-push-action@v6
with:
context: .
build-contexts: zip=./coordinator/app/build/distributions/
file: ./coordinator/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }}-${{ env.UNTESTED_TAG_SUFFIX }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max