Skip to content

Maven docker for maven #65

Maven docker for maven

Maven docker for maven #65

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 jar:jar
- 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
#- name: Build and push
# uses: docker/build-push-action@v6
# with:
# context: .
# file: das-producer/Dockerfile
# platforms: linux/amd64,linux/arm64
# push: true
# tags: ${{inputs.DOCKER_REGISTRY}}/${{inputs.IMAGE_NAME}}:${{ inputs.IMAGE_TAG }}