caviri
commited on
Commit
·
667ff60
1
Parent(s):
629b3ac
ci: Simplifying CI-HF
Browse files- .github/workflows/push_to_hf.yml +15 -23
.github/workflows/push_to_hf.yml
CHANGED
@@ -1,28 +1,20 @@
|
|
1 |
-
name:
|
2 |
-
|
3 |
on:
|
4 |
-
|
5 |
-
|
|
|
|
|
6 |
|
7 |
jobs:
|
8 |
-
|
9 |
-
if: github.event.pull_request.merged == true
|
10 |
runs-on: ubuntu-latest
|
11 |
-
|
12 |
steps:
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
run: |
|
23 |
-
git clone https://${{ env.HF_USERNAME }}:${{ env.HF_TOKEN }}@huggingface.co/spaces/SDSC/digiwild hf_repo
|
24 |
-
rsync -av --exclude='hf_repo' github_repo/ hf_repo/
|
25 |
-
cd hf_repo
|
26 |
-
git add .
|
27 |
-
git commit -m "Update from main branch"
|
28 |
-
git push origin main
|
|
|
1 |
+
name: Sync to Hugging Face hub
|
|
|
2 |
on:
|
3 |
+
push:
|
4 |
+
branches: [main]
|
5 |
+
# to run this workflow manually from the Actions tab
|
6 |
+
workflow_dispatch:
|
7 |
|
8 |
jobs:
|
9 |
+
sync-to-hub:
|
|
|
10 |
runs-on: ubuntu-latest
|
|
|
11 |
steps:
|
12 |
+
- uses: actions/checkout@v3
|
13 |
+
with:
|
14 |
+
fetch-depth: 0
|
15 |
+
lfs: true
|
16 |
+
- name: Push to hub
|
17 |
+
env:
|
18 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
19 |
+
HF_USERNAME: ${{secrets.HF_USERNAME}}
|
20 |
+
run: git push https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/sdsc/digiwild main
|
|
|
|
|
|
|
|
|
|
|
|
|
|