Spaces:
Running
Running
Aaryan Parik
fix: harden HF Space Docker runtime, session isolation, hardware profiles, and tests
0a7b128 Download .github/workflows/sync_to_hf_space.yml from SnippyCodes/Libratio: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/SnippyCodes/Libratio/resolve/main/.github/workflows/sync_to_hf_space.yml
- Command line
-
hf download hf://spaces/SnippyCodes/Libratio/.github/workflows/sync_to_hf_space.yml
-
curl -L -o sync_to_hf_space.yml https://huggingface.co/spaces/SnippyCodes/Libratio/resolve/main/.github/workflows/sync_to_hf_space.yml
1.03 kB
| name: Sync to Hugging Face Space | |
| on: | |
| push: | |
| branches: [main] | |
| # Enables you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| sync-to-hub: | |
| runs-on: ubuntu-latest | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| - name: Run tests before deploying | |
| run: | | |
| pip install -r requirements.txt pytest pytest-asyncio | |
| pytest -q | |
| - name: Push to hub | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| if [ -z "$HF_TOKEN" ]; then | |
| echo "Error: HF_TOKEN is empty! Make sure you added it exactly as 'HF_TOKEN' in Settings > Secrets and variables > Actions" | |
| exit 1 | |
| fi | |
| git remote add space https://SnippyCodes:$HF_TOKEN@huggingface.co/spaces/SnippyCodes/Libratio | |
| git push -f space main | |