Spaces:
Running
Running
Download .github/workflows/deploy-hf.yml from Liisdotcom/simulator: direct link, hf CLI and curl.
- Browser
- Download file 1.26 kB
-
https://huggingface.co/spaces/Liisdotcom/simulator/resolve/main/.github/workflows/deploy-hf.yml
- Command line
-
hf download hf://spaces/Liisdotcom/simulator/.github/workflows/deploy-hf.yml
-
curl -L -o deploy-hf.yml https://huggingface.co/spaces/Liisdotcom/simulator/resolve/main/.github/workflows/deploy-hf.yml
1.26 kB
| 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 | |