| name: Deploy to HuggingFace Spaces |
|
|
| on: |
| push: |
| branches: |
| - main |
| - master |
| workflow_dispatch: |
|
|
| jobs: |
| deploy: |
| runs-on: ubuntu-latest |
| steps: |
| - name: Checkout code |
| uses: actions/checkout@v3 |
| with: |
| fetch-depth: 0 |
|
|
| - name: Push to HuggingFace Space |
| env: |
| HF_TOKEN: ${{ secrets.HF_TOKEN }} |
| HF_USERNAME: ${{ secrets.HF_USERNAME }} |
| HF_SPACE_NAME: ${{ secrets.HF_SPACE_NAME }} |
| 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://${HF_USERNAME}:${HF_TOKEN}@huggingface.co/spaces/${HF_USERNAME}/${HF_SPACE_NAME} |
| |
| |
| git push hf main --force |
|
|
|
|