3v324v23's picture
Deploy from GitHub
4d1487f
Raw History Blame Contribute Delete
898 Bytes
name: Deploy to Hugging Face
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Git LFS
run: git lfs install
- name: Clone HF Space
run: |
git clone https://huggingface.co/spaces/sancloudmlops/flask-random-fruit hf-space
- name: Copy files
run: |
rsync -av --exclude='.git' ./ hf-space/
- name: Commit & Push to HF
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
cd hf-space
git config user.email "you@example.com"
git config user.name "github-actions"
git add .
git commit -m "Deploy from GitHub" || echo "No changes"
git push https://sancloudmlops:$HF_TOKEN@huggingface.co/spaces/sancloudmlops/flask-random-fruit main