Spaces:
Build error

trackademi / .github /workflows /deploy.yml
anwarKXC
Infra: add production requirements without surya-ocr/torch for VPS deployment
83b4b32
Raw History Blame Contribute Delete
2.11 kB
# Install as .github/workflows/deploy.yml in AnwarKXC/chatbot
#
# Thin caller. All build and deploy logic lives in the infra repo's reusable
# workflow so there is one place to change it.
#
# Required repo secrets: VPS_HOST, VPS_USER, VPS_SSH_KEY
#
# NOTE: the production image installs from requirements-prod.txt, which
# excludes surya-ocr / transformers / torch. Those add 2.0-2.5 GB of RSS and do
# not fit the 8 GB VPS; Google Vision is the only OCR engine in production.
# See docs/ARCHITECTURE.md in the infra repo.
name: Deploy AI service
on:
push:
branches: [master]
# Release builds. Tagging `v1.2.0` deploys under that name instead of the
# git SHA — far more legible in `rollback.sh`'s list. The SHA tag is pushed
# either way, so rollback never depends on someone having tagged.
tags: ['v*.*.*']
paths-ignore:
# NOTE: GitHub applies paths filters to tag pushes too. Tagging a release
# whose commit only touched docs will therefore skip the build — use the
# workflow_dispatch below in that case.
- '**.md'
- 'docs/**'
- '.gitignore'
- 'LICENSE'
workflow_dispatch:
inputs:
deploy:
description: 'Deploy after building'
type: boolean
default: true
jobs:
build-deploy:
uses: AnwarKXC/trackademi-infra/.github/workflows/build-deploy.yml@master
with:
service: ai
image_name: trackademi-ai
context: .
dockerfile: ./Dockerfile
# Selected EXPLICITLY, because the Dockerfile default is the full
# requirements set. That default protects the Hugging Face Space, which
# builds the same Dockerfile with no build args — see the comment in
# chatbot/Dockerfile. Only the VPS gets the lean image.
build_args: |
REQUIREMENTS_FILE=requirements-prod.txt
deploy: ${{ github.event_name != 'workflow_dispatch' || inputs.deploy }}
secrets:
VPS_HOST: ${{ secrets.VPS_HOST }}
VPS_USER: ${{ secrets.VPS_USER }}
VPS_SSH_KEY: ${{ secrets.VPS_SSH_KEY }}
GHCR_TOKEN: ${{ secrets.GHCR_TOKEN }}