Spaces:
Sleeping
Sleeping
CI: auto‑deploy Space
Browse files
.github/workflows/deploy.yaml
CHANGED
@@ -1,20 +1,26 @@
|
|
1 |
-
name: Deploy to Hugging
|
2 |
|
3 |
on:
|
4 |
push:
|
5 |
-
branches: [ main ] #
|
6 |
|
7 |
jobs:
|
8 |
deploy:
|
9 |
runs-on: ubuntu-latest
|
|
|
10 |
steps:
|
11 |
-
- uses: actions/checkout@v4
|
|
|
12 |
- name: Push repo to HF Space
|
13 |
env:
|
14 |
-
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
15 |
run: |
|
16 |
git config --global user.email "ci@github"
|
17 |
git config --global user.name "github-ci"
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
20 |
git push -f hf HEAD:main
|
|
|
1 |
+
name: Deploy to Hugging Face Space
|
2 |
|
3 |
on:
|
4 |
push:
|
5 |
+
branches: [ main ] # rebuild Space on every push to main
|
6 |
|
7 |
jobs:
|
8 |
deploy:
|
9 |
runs-on: ubuntu-latest
|
10 |
+
|
11 |
steps:
|
12 |
+
- uses: actions/checkout@v4 # pulls repo
|
13 |
+
|
14 |
- name: Push repo to HF Space
|
15 |
env:
|
16 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }} # GitHub secret with write scope
|
17 |
run: |
|
18 |
git config --global user.email "ci@github"
|
19 |
git config --global user.name "github-ci"
|
20 |
+
|
21 |
+
# add (or update) the remote exactly once
|
22 |
+
git remote add hf https://[email protected]/spaces/MooseML/homo-lumo-gap-predictor || \
|
23 |
+
git remote set-url hf https://[email protected]/spaces/MooseML/homo-lumo-gap-predictor
|
24 |
+
|
25 |
+
# push current branch (main) to the Space
|
26 |
git push -f hf HEAD:main
|