Skip to content

LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows

Unified the workflow for manual/automated build and push (#365)

Rahul Johny0b6fbe5a3fdc
diff --git a/.github/workflows/docker-build-push-dev.yaml b/.github/workflows/docker-build-push-dev.yaml
deleted file mode 100644
index 5de4324da..000000000
--- a/.github/workflows/docker-build-push-dev.yaml
+++ /dev/null
@@ -1,65 +0,0 @@
-name: Unstract Docker Image Build and Push (Development)
-
-on:
- workflow_dispatch:
- inputs:
- tag:
- description: "Docker image tag"
- required: true
- default: "latest"
- service_name:
- description: "Service to build"
- required: true
- default: "backend" # Provide a default value
- type: choice
- options: # Define available options
- - all-services
- - frontend
- - backend
- - document-service
- - platform-service
- - worker
- - prompt-service
- - x2text-service
-
-run-name: "[${{ inputs.service_name }}] 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@v2
-
- - name: Login to Docker Hub
- uses: docker/login-action@v1
- with:
- username: ${{ secrets.DOCKERHUB_USERNAME }}
- password: ${{ secrets.DOCKERHUB_TOKEN }}
-
- # Build and push Docker image for the specified service
- - name: Build and push image for ${{ github.event.inputs.service_name }}
- working-directory: ./docker
- if: github.event.inputs.service_name != 'all-services'
- run: |
- VERSION=${{ github.event.inputs.tag }} docker compose -f docker-compose.build.yaml build --no-cache ${{ github.event.inputs.service_name }}
- docker push unstract/${{ github.event.inputs.service_name }}:${{ github.event.inputs.tag }}
-
- # Build and push all service images
- - name: Build and push all images
- working-directory: ./docker
- if: github.event.inputs.service_name == 'all-services'
- run: |
- VERSION=${{ github.event.inputs.tag }} docker-compose -f docker-compose.build.yaml build --no-cache
- # Push all built images
- docker push unstract/backend:${{ github.event.inputs.tag }}
- docker push unstract/frontend:${{ github.event.inputs.tag }}
- # document-service is an optional. so it is commented out
- # docker push unstract/document-service:${{ github.event.inputs.tag }}
- docker push unstract/platform-service:${{ github.event.inputs.tag }}
- docker push unstract/worker:${{ github.event.inputs.tag }}
- docker push unstract/prompt-service:${{ github.event.inputs.tag }}
- docker push unstract/x2text-service:${{ github.event.inputs.tag }}
diff --git a/.github/workflows/production-build.yaml b/.github/workflows/production-build.yaml
index d7e2d2dfb..da88582d7 100644
--- a/.github/workflows/production-build.yaml
+++ b/.github/workflows/production-build.yaml
@@ -1,11 +1,17 @@
name: Unstract Docker Image Build and Push (Production)
on:
+ workflow_dispatch:
+ inputs:
+ tag:
+ description: "Docker image tag"
+ required: true
+
release:
types:
- created
-run-name: "[${{ github.event.release.tag_name }}] Docker Image Build and Push (Production)"
+run-name: "[${{ github.event.release.tag_name || github.event.inputs.tag }}] Docker Image Build and Push (Production)"
jobs:
build-and-push:
@@ -15,11 +21,18 @@ jobs:
service_name: [backend, frontend, document-service, platform-service, prompt-service, worker, x2text-service]
steps:
- - name: Checkout code
+ - name: Checkout code for release
+ if: github.event_name == 'release'
uses: actions/checkout@v2
with:
ref: ${{ github.event.release.tag_name }}
+
+ - name: Checkout code for branch
+ if: github.event_name != 'release'
+ uses: actions/checkout@v2
+
+
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
@@ -29,7 +42,11 @@ jobs:
- name: Build and push images
working-directory: ./docker
run: |
- VERSION=${{ github.event.release.tag_name }} docker-compose -f docker-compose.build.yaml build --no-cache ${{ matrix.service_name }}
- docker tag unstract/${{ matrix.service_name }}:${{ github.event.release.tag_name }} unstract/${{ matrix.service_name }}:latest
- docker push unstract/${{ matrix.service_name }}:${{ github.event.release.tag_name }}
- docker push unstract/${{ matrix.service_name }}:latest
+ DOCKER_VERSION_TAG = ${{ github.event.release.tag_name || github.event.inputs.tag}}
+ VERSION=$DOCKER_VERSION_TAG docker-compose -f docker-compose.build.yaml build --no-cache ${{ matrix.service_name }}
+ docker push unstract/${{ matrix.service_name }}:$DOCKER_VERSION_TAG
+ if [ "${{ github.event_name }}" = "release" ]; then
+ echo "This workflow was triggered by a release event."
+ docker tag unstract/${{ matrix.service_name }}:$DOCKER_VERSION_TAG unstract/${{ matrix.service_name }}:latest
+ docker push unstract/${{ matrix.service_name }}:latest
+ fi