feat: implement ldio ldes client connector (#403) #376
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 2.b Build LDIO Docker | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
workflow_dispatch: | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ldi-orchestrator | |
jobs: | |
build-docker-ldio: | |
name: Build and push LDIO image | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v2 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
with: | |
# Temporary workaround for buildx problem | |
# See: https://github.com/docker/build-push-action/issues/761#issuecomment-1383822381 | |
driver-opts: | | |
image=moby/buildkit:v0.10.6 | |
- name: Set up JDK 18 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: zulu | |
java-version: 18 | |
- name: Determine version | |
run: | | |
export VERSION=$(mvn help:evaluate -Dexpression="project.version" -q -DforceStdout) | |
echo "version=$VERSION" >> $GITHUB_ENV | |
- name: Define docker variables | |
run: | | |
if [[ "${{ github.ref }}" == "refs/heads/main" ]]; then | |
echo "IMAGE_TAG=${{ env.version }}" >> $GITHUB_ENV | |
echo "IMAGES=ldes/${{ env.IMAGE_NAME }}" >> $GITHUB_ENV | |
if [[ "${{ env.version }}" != *"SNAPSHOT"* ]]; then | |
echo "LATEST=latest" >> $GITHUB_ENV | |
fi | |
else | |
echo "IMAGE_TAG=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV | |
echo "IMAGES=${{ env.REGISTRY }}/Informatievlaanderen/${{ env.IMAGE_NAME }}" >> $GITHUB_ENV | |
echo "LATEST=latest" >> $GITHUB_ENV | |
fi | |
- name: Log in to the DockerHub Container registry | |
if: github.ref_name == 'main' | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASSWORD }} | |
- name: Log in to the GitHub Container registry | |
if: github.ref_name != 'main' | |
uses: docker/login-action@v2 | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: Informatievlaanderen | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v4 | |
with: | |
images: ${{ env.IMAGES }} | |
tags: | | |
type=raw,value=${{env.IMAGE_TAG}} | |
type=raw,value=${{env.LATEST}} | |
- name: Build and push Docker image | |
uses: docker/build-push-action@v3 | |
with: | |
context: . | |
push: true | |
file: ldio.Dockerfile | |
tags: ${{ steps.meta.outputs.tags }} | |
platforms: linux/amd64,linux/arm64 |