Spaces:
Sleeping
Sleeping
Download .github/workflows/deploy.yml from adityacodes404/doc-oc: direct link, hf CLI and curl.
- Browser
- Download file 1.18 kB
-
https://huggingface.co/spaces/adityacodes404/doc-oc/resolve/main/.github/workflows/deploy.yml
- Command line
-
hf download hf://spaces/adityacodes404/doc-oc/.github/workflows/deploy.yml
-
curl -L -o deploy.yml https://huggingface.co/spaces/adityacodes404/doc-oc/resolve/main/.github/workflows/deploy.yml
1.18 kB
| name: Sync to Hugging Face Hub | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| sync-to-hub: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions" | |
| git config --global user.email "actions@github.com" | |
| - name: Push to Hugging Face Space | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| git remote add hf https://oauth2:${HF_TOKEN}@huggingface.co/spaces/adityacodes404/doc-oc | |
| # Disable unsupported LFS locking API on HF | |
| git config lfs.https://huggingface.co/spaces/adityacodes404/doc-oc.git/info/lfs.locksverify false | |
| # Only push LFS objects if model files changed in this commit | |
| if git diff --name-only HEAD~1 HEAD 2>/dev/null | grep -q "^models/"; then | |
| echo "Model files changed — pushing LFS objects..." | |
| git lfs push hf --all | |
| else | |
| echo "No model changes — skipping LFS push." | |
| fi | |
| git push hf main --force |