[tool-structure:0.0.46] Docker Image Build and Push (Development) #134
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: 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 }} |