Spaces:
Running
Running
Download .github/workflows/deploy-hf.yml from taskpilot952476/taskpilot: direct link, hf CLI and curl.
- Browser
- Download file 1.7 kB
-
https://huggingface.co/spaces/taskpilot952476/taskpilot/resolve/main/.github/workflows/deploy-hf.yml
- Command line
-
hf download hf://spaces/taskpilot952476/taskpilot/.github/workflows/deploy-hf.yml
-
curl -L -o deploy-hf.yml https://huggingface.co/spaces/taskpilot952476/taskpilot/resolve/main/.github/workflows/deploy-hf.yml
1.7 kB
| name: Sync to Hugging Face Hub | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v5 | |
| - name: Set up Java 25 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: "25" | |
| distribution: "temurin" | |
| cache: "maven" | |
| - name: Run Maven Tests | |
| run: mvn clean test -B | |
| - name: Test Docker Build (Hugging Face Space verification) | |
| run: docker build -t taskpilot-hf-test . | |
| sync-to-hub: | |
| needs: build-and-test | |
| if: github.event_name == 'push' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the repository | |
| uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 # Fetch all history for git info | |
| - name: Push to Hugging Face | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "github-actions[bot]" | |
| git remote add hf https://taskpilot952476:$HF_TOKEN@huggingface.co/spaces/taskpilot952476/taskpilot | |
| # Hugging Face Hub rejects binary docs assets in this repository history. | |
| # Build a clean orphan commit that excludes docs implementation assets. | |
| git checkout --orphan hf-sync | |
| git rm -rf --cached . | |
| git add . | |
| git rm -r --cached --ignore-unmatch docs/implementation | |
| git commit -m "Sync repository to Hugging Face Space" | |
| git push -f hf HEAD:main | |