github-actions
Auto deploy
c325a23
Raw
History Blame Contribute Delete
948 Bytes
name: Deploy to Hugging Face Space
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
lfs: true
- name: Install rsync
run: sudo apt-get install -y rsync
- name: Deploy to Hugging Face
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
git config --global user.email "actions@github.com"
git config --global user.name "github-actions"
git clone https://huggingface.co/spaces/RijjaExplore/infravision-ai-api hf-space
rsync -av --exclude='.git' ./ hf-space/
cd hf-space
git add .
git commit -m "Auto deploy" || echo "No changes"
git push https://RijjaExplore:${HF_TOKEN}@huggingface.co/spaces/RijjaExplore/infravision-ai-api main