Download .github/workflows/deploy.yml from luci18/animebot: direct link, hf CLI and curl.
- Browser
- Download file 1.21 kB
-
https://huggingface.co/luci18/animebot/resolve/main/.github/workflows/deploy.yml
- Command line
-
hf download hf://luci18/animebot/.github/workflows/deploy.yml
-
curl -L -o deploy.yml https://huggingface.co/luci18/animebot/resolve/main/.github/workflows/deploy.yml
1.21 kB
| name: Deploy to Hugging Face | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Setup Git | |
| run: | | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --global user.name "GitHub Actions" | |
| - name: Push to Hugging Face | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| HF_SPACE_ID: luci18/animebot | |
| run: | | |
| # Install Hugging Face CLI | |
| pip install huggingface-hub | |
| # Authenticate | |
| huggingface-cli login --token $HF_TOKEN | |
| # Clone the space | |
| git clone https://huggingface.co/spaces/$HF_SPACE_ID hf-space | |
| # Copy files (excluding secrets) | |
| rsync -av --exclude='.git' --exclude='.env' --exclude='downloads' --exclude='encodes' --exclude='temp' --exclude='*.session' --exclude='__pycache__' . hf-space/ | |
| # Commit and push | |
| cd hf-space | |
| git add . | |
| git commit -m "Deploy from GitHub Actions - $(date)" || echo "No changes to commit" | |
| git push | |