P2 / .github /workflows /deploy-huggingface-space.yml
q6's picture
github Action
52a8da5
raw
history blame contribute delete
751 Bytes
name: Deploy Hugging Face Space
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: deploy-huggingface-space
cancel-in-progress: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
persist-credentials: false
- name: Push to Hugging Face Space
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote add huggingface "https://oauth2:${HF_TOKEN}@huggingface.co/spaces/q6/P2"
git push --force huggingface HEAD:main