OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.
Python
feat: add manual docker publish workflow (#1122)
Lucas Oliveiraa04909cd28ef
diff --git a/.github/workflows/manual-docker-publish.yml b/.github/workflows/manual-docker-publish.ymlnew file mode 100644index 000000000..49bb67684--- /dev/null+++ b/.github/workflows/manual-docker-publish.yml@@ -0,0 +1,101 @@+name: Manual Docker Publish++on:+ workflow_dispatch:+ inputs:+ tag:+ description: 'Tag for the images (defaults to branch name if empty)'+ required: false+ platforms:+ description: 'Platforms to build for (e.g., linux/amd64,linux/arm64)'+ required: true+ default: 'linux/amd64'++jobs:+ build-and-publish:+ runs-on: ubuntu-latest+ steps:+ - name: Checkout+ uses: actions/checkout@v4++ - name: Set up QEMU+ uses: docker/setup-qemu-action@v3++ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Login to Docker Hub+ uses: docker/login-action@v3+ with:+ username: ${{ secrets.DOCKER_USERNAME }}+ password: ${{ secrets.DOCKER_PASSWORD }}++ - name: Determine Tag+ id: vars+ run: |+ # Choose raw tag: user input if provided, otherwise branch name+ if [ -z "${{ github.event.inputs.tag }}" ]; then+ RAW_TAG="${{ github.ref_name }}"+ else+ RAW_TAG="${{ github.event.inputs.tag }}"+ fi++ # Replace invalid characters with '-', keep only [A-Za-z0-9_.-]+ SANITIZED_TAG=$(echo "$RAW_TAG" | sed 's/[^A-Za-z0-9_.-]/-/g')++ # Ensure the tag starts with an alphanumeric character by stripping leading non-alphanumerics+ SANITIZED_TAG=$(echo "$SANITIZED_TAG" | sed 's/^[^A-Za-z0-9]*//')++ # Fallback to a safe default if the tag becomes empty+ if [ -z "$SANITIZED_TAG" ]; then+ SANITIZED_TAG="latest"+ fi++ # Truncate to Docker's maximum tag length (128 characters)+ TAG=$(printf '%.128s' "$SANITIZED_TAG")++ echo "tag=$TAG" >> "$GITHUB_OUTPUT"++ - name: Build and push Backend+ uses: docker/build-push-action@v6+ with:+ context: .+ file: ./Dockerfile.backend+ platforms: ${{ github.event.inputs.platforms }}+ push: true+ tags: ${{ secrets.DOCKER_NAMESPACE }}/openrag-backend:${{ steps.vars.outputs.tag }}+ cache-from: type=gha,scope=backend+ cache-to: type=gha,mode=max,scope=backend++ - name: Build and push Frontend+ uses: docker/build-push-action@v6+ with:+ context: .+ file: ./Dockerfile.frontend+ platforms: ${{ github.event.inputs.platforms }}+ push: true+ tags: ${{ secrets.DOCKER_NAMESPACE }}/openrag-frontend:${{ steps.vars.outputs.tag }}+ cache-from: type=gha,scope=frontend+ cache-to: type=gha,mode=max,scope=frontend++ - name: Build and push Langflow+ uses: docker/build-push-action@v6+ with:+ context: .+ file: ./Dockerfile.langflow+ platforms: ${{ github.event.inputs.platforms }}+ push: true+ tags: ${{ secrets.DOCKER_NAMESPACE }}/openrag-langflow:${{ steps.vars.outputs.tag }}+ cache-from: type=gha,scope=langflow+ cache-to: type=gha,mode=max,scope=langflow++ - name: Build and push OpenSearch+ uses: docker/build-push-action@v6+ with:+ context: .+ file: ./Dockerfile+ platforms: ${{ github.event.inputs.platforms }}+ push: true+ tags: ${{ secrets.DOCKER_NAMESPACE }}/openrag-opensearch:${{ steps.vars.outputs.tag }}+ cache-from: type=gha,scope=opensearch+ cache-to: type=gha,mode=max,scope=opensearch