Crop-Guard-AI / .github /workflows /sync_to_hub.yml
GitHub Action
Auto-deploy from GitHub
30a274a
Raw
History Blame Contribute Delete
807 Bytes
name: Sync to Hugging Face hub
on:
push:
branches: [main]
workflow_dispatch:
jobs:
sync-to-hub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
lfs: true
- name: Push to hub
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
rm -rf .git
git init
git remote add origin https://Usefulmech:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/build-small-hackathon/Crop-Guard-AI
git config user.name "GitHub Action"
git config user.email "action@github.com"
git checkout -b main
git lfs install
git lfs track "*.png"
git add .
git commit -m "Auto-deploy from GitHub"
git push --force origin main