name: Deploy to HF Space on: workflow_dispatch: # Manual trigger only inputs: confirm: description: 'Type "deploy" to confirm deployment' required: true default: '' jobs: deploy: runs-on: ubuntu-latest if: github.event.inputs.confirm == 'deploy' steps: - name: Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 # Full history for push - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.11' cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Run tests before deploy run: pytest tests/ -v --tb=short - name: Deploy to Hugging Face Space env: HF_TOKEN: ${{ secrets.HF_TOKEN }} run: | git remote add hf https://user:${HF_TOKEN}@huggingface.co/spaces/Liisdotcom/simulator || true git push hf main --force - name: Deployment summary run: | echo "## Deployment Complete" >> $GITHUB_STEP_SUMMARY echo "Deployed to: https://huggingface.co/spaces/Liisdotcom/simulator" >> $GITHUB_STEP_SUMMARY