name: Sync to Hugging Face Hub on: push: branches: ["main","staging"] # Allows you to manually trigger this workflow from the Actions tab workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout repository assets uses: actions/checkout@v4 with: fetch-depth: 0 - name: Set up Python environment uses: actions/setup-python@v5 with: python-version: '3.10' - name: Install official Hugging Face CLI tool run: pip install huggingface_hub - name: Authenticate and upload project space via dedicated tunnel env: HF_TOKEN: ${{ secrets.HF_TOKEN }} # Traffic Controller: If the branch is main, use production. Otherwise, use staging. HF_SPACE: ${{ github.ref_name == 'main' && 'catalyst-intelligence/ClariFood' || 'catalyst-intelligence/Staging-ClariFood' }} run: | hf auth login --token $HF_TOKEN hf upload $HF_SPACE . --repo-type space