Skip to content

[tool-structure:0.0.52] Docker Image Build and Push (Development) #148

[tool-structure:0.0.52] Docker Image Build and Push (Development)

[tool-structure:0.0.52] Docker Image Build and Push (Development) #148

name: Unstract Tools Docker Image Build and Push (Development)
on:
workflow_dispatch:
inputs:
tag:
description: "Docker image tag"
required: true
default: "latest"
service_name:
description: "Tool to build"
required: true
default: "tool-structure" # Provide a default value
type: choice
options: # Define available options
- tool-classifier
- tool-structure
- tool-text-extractor
run-name: "[${{ inputs.service_name }}:${{ inputs.tag }}] Docker Image Build and Push (Development)"
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Output Inputs
run: echo "${{ toJSON(github.event.inputs) }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build tool-classifier
if: github.event.inputs.service_name=='tool-classifier'
run: docker build -t unstract/${{github.event.inputs.service_name}}:${{ github.event.inputs.tag }} ./tools/classifier
- name: Build tool-structure
if: github.event.inputs.service_name=='tool-structure'
run: docker build -t unstract/${{github.event.inputs.service_name}}:${{ github.event.inputs.tag }} ./tools/structure
- name: Build tool-text-extractor
if: github.event.inputs.service_name=='tool-text-extractor'
run: docker build -t unstract/${{github.event.inputs.service_name}}:${{ github.event.inputs.tag }} ./tools/text_extractor
- name: Push Docker image to Docker Hub
run: docker push unstract/${{ github.event.inputs.service_name }}:${{ github.event.inputs.tag }}