-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (49 loc) · 1.77 KB
/
maven-make-docker.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
name: Maven docker for maven
on:
workflow_dispatch:
inputs:
DOCKER_REGISTRY:
required: true
DOCKER_REGISTRY_USER:
required: true
DOCKER_REGISTRY_TOKEN:
required: true
IMAGE_NAME:
default: "das-producer"
IMAGE_TAG:
required: true
jobs:
make-docker:
runs-on: ubuntu-latest
steps:
- name: Masking inputs
id: add_mask
run: |
INP_SECRET_TOKEN=$(jq -r '.inputs.DOCKER_REGISTRY_TOKEN' $GITHUB_EVENT_PATH)
echo ::add-mask::$INP_SECRET_TOKEN
echo DOCKER_REGISTRY_TOKEN="$INP_SECRET_TOKEN" >> $GITHUB_ENV
- uses: actions/[email protected]
- name: Docker login
run: echo ${DOCKER_REGISTRY_TOKEN}| docker login ${{ inputs.DOCKER_REGISTRY }} --username ${{ inputs.DOCKER_REGISTRY_USER }} --password-stdin
- name: Set up JDK 21
uses: actions/[email protected]
with:
java-version: 21
distribution: 'zulu'
- uses: s4u/[email protected]
with:
servers: |
[{
"id": "fiberoptics-das-public-schemas",
"username": "${{secrets.PUBLIC_SCHEMA_USER}}",
"password": "${{ secrets.PUBLIC_SCHEMA_TOKEN }}"
}]
- name: Build, test and package
run: ./mvnw -B clean test compile
- uses: docker/[email protected]
id: buildx
with:
install: true
- name: Docker ${{inputs.DOCKER_REGISTRY}}/${{inputs.IMAGE_NAME}}:${{ inputs.IMAGE_TAG }}
run: |
docker buildx build --platform linux/amd64,linux/arm64 . -f das-producer/Dockerfile -t ${{inputs.DOCKER_REGISTRY}}/${{inputs.IMAGE_NAME}}:${{ inputs.IMAGE_TAG }} --push