Spaces:
Running
Running
| name: Deploy to HuggingFace Space | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout FULL history | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install Git LFS | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y git-lfs | |
| git lfs install --force | |
| - name: Configure Git | |
| run: | | |
| git config --global user.email "github-actions@github.com" | |
| git config --global user.name "github-actions" | |
| - name: Push to HuggingFace Space | |
| env: | |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} | |
| run: | | |
| set -e | |
| # Remove existing remote | |
| git remote remove space 2>/dev/null || true | |
| # Add HF remote with token authentication | |
| git remote add space https://AhmadYarAI:${HF_TOKEN}@huggingface.co/spaces/AhmadYarAI/famfin-api | |
| # Push to HuggingFace | |
| git push space HEAD:main --force | |