Spaces:
Sleeping
Sleeping
Create .github/workflows/deploy.yml
Browse files- .github/workflows/deploy.yml +37 -0
.github/workflows/deploy.yml
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Deploy to Hugging Face Space
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: ["main"]
|
| 6 |
+
|
| 7 |
+
jobs:
|
| 8 |
+
deploy:
|
| 9 |
+
runs-on: ubuntu-latest
|
| 10 |
+
|
| 11 |
+
steps:
|
| 12 |
+
- name: Checkout GitHub repo
|
| 13 |
+
uses: actions/checkout@v4
|
| 14 |
+
|
| 15 |
+
- name: Configure Git
|
| 16 |
+
run: |
|
| 17 |
+
git config --global user.email "actions@github.com"
|
| 18 |
+
git config --global user.name "GitHub Actions"
|
| 19 |
+
|
| 20 |
+
- name: Clone HF Space repo
|
| 21 |
+
run: |
|
| 22 |
+
git clone https://__token__:${{ secrets.TEAMCAREERPROGRESSIONAPPTOKEN }}@huggingface.co/${{ secrets.HF_SPACE }} hf_repo
|
| 23 |
+
|
| 24 |
+
- name: Sync project files to Space (overwrite)
|
| 25 |
+
run: |
|
| 26 |
+
rsync -av --delete \
|
| 27 |
+
--exclude="hf_repo" \
|
| 28 |
+
--exclude=".git" \
|
| 29 |
+
--exclude=".github" \
|
| 30 |
+
./ hf_repo/
|
| 31 |
+
|
| 32 |
+
- name: Commit & Push
|
| 33 |
+
run: |
|
| 34 |
+
cd hf_repo
|
| 35 |
+
git add .
|
| 36 |
+
git commit -m "Auto deploy from GitHub" || echo "No changes"
|
| 37 |
+
git push
|