-
Notifications
You must be signed in to change notification settings - Fork 3
59 lines (49 loc) · 1.66 KB
/
publish.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
name: CI
on:
push:
branches:
- main
release:
types: [released]
jobs:
docker_publish:
if: github.event_name != 'pull_request'
runs-on: ubuntu-latest
env:
architecture: "amd64"
GRADLE_OPTS: "-Xmx6g -Dorg.gradle.parallel=true -Dorg.gradle.workers.max=4"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: temurin
- name: Set up QEMU for Docker
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
platforms: linux/amd64,linux/arm64
- name: Check Dockerfile syntax
run: |
docker run --rm -i hadolint/hadolint < docker/Dockerfile
- name: Login to Docker Hub for self hosted
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER_RW }}
password: ${{ secrets.DOCKER_PAT_RW }}
- name: Get the version
if: github.event_name == 'release'
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Build and Publish Docker Image
run: |
if [ "${{ github.event_name }}" == "release" ]; then \
./gradlew -PdockerOrgName=${{ secrets.DOCKER_ORG_NAME }} -Pdocker-platform=linux/arm64 distDocker -PreleaseVersion=${{ steps.get_version.outputs.VERSION }}; \
else \
./gradlew -PdockerOrgName=${{ secrets.DOCKER_ORG_NAME }} -Pdocker-platform=linux/arm64 distDocker; \
fi