Skip to content

Publish Docker Images #28

Publish Docker Images

Publish Docker Images #28

# Build and publish docker images for the following services:
# UI
# API Server
# Data Analytics Server
# Evaluation Server
name: Publish Docker Images
on:
workflow_dispatch:
inputs:
version:
description: "Dockerhub image version"
required: true
env:
LATEST_TAG: latest
VERSION_TAG: ${{ github.event.inputs.version }}
APP_UI: ui-tio
APP_API: api-tio
APP_DA: da-server-tio
APP_EVAL: evaluation-server-tio
jobs:
build-publish:
name: build and publish image to docker hub
runs-on: ubuntu-latest
environment: Production
steps:
- name: Checkout
uses: actions/checkout@v3
- # Add support for more platforms with QEMU
# https://github.com/docker/setup-qemu-action
name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Build and push - UI
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:modules/front-end"
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_UI }}:${{ env.VERSION_TAG }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_UI }}:${{ env.LATEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push - API-Server
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:modules/back-end"
file: ./deploy/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_API }}:${{ env.VERSION_TAG }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_API }}:${{ env.LATEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push - Data-Analytics-Server
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:modules/data-analytics"
file: ./Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_DA }}:${{ env.VERSION_TAG }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_DA }}:${{ env.LATEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push - Evaluation-Server
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:modules/evaluation-server"
file: ./deploy/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_EVAL }}:${{ env.VERSION_TAG }}
${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_EVAL }}:${{ env.LATEST_TAG }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_UI }}
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_API }}
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_DA }}
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ secrets.DOCKER_HUB_USERNAME }}/${{ env.APP_EVAL }}