Spaces:
Sleeping
Sleeping
ci: add workflow_dispatch to hf-depression
Browse files
.github/workflows/sync-to-hf.yml
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync hf-depression to HF Space main
|
| 2 |
+
|
| 3 |
+
on:
|
| 4 |
+
push:
|
| 5 |
+
branches: [ hf-depression ]
|
| 6 |
+
workflow_dispatch: {}
|
| 7 |
+
|
| 8 |
+
jobs:
|
| 9 |
+
sync:
|
| 10 |
+
runs-on: ubuntu-latest
|
| 11 |
+
steps:
|
| 12 |
+
- name: Checkout hf-depression (with LFS)
|
| 13 |
+
uses: actions/checkout@v4
|
| 14 |
+
with:
|
| 15 |
+
ref: hf-depression
|
| 16 |
+
lfs: true
|
| 17 |
+
fetch-depth: 0
|
| 18 |
+
|
| 19 |
+
- name: Setup Git LFS
|
| 20 |
+
run: |
|
| 21 |
+
git lfs install
|
| 22 |
+
git lfs fetch --all
|
| 23 |
+
|
| 24 |
+
- name: Push hf-depression to HF Space main
|
| 25 |
+
env:
|
| 26 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 27 |
+
run: |
|
| 28 |
+
set -e
|
| 29 |
+
git config user.email "actions@github.com"
|
| 30 |
+
git config user.name "github-actions[bot]"
|
| 31 |
+
SPACE_ID="zzejiao/depression"
|
| 32 |
+
TARGET_BRANCH="main"
|
| 33 |
+
AUTHED_URL="https://user:${HF_TOKEN}@huggingface.co/spaces/${SPACE_ID}"
|
| 34 |
+
git remote add hf "$AUTHED_URL" || git remote set-url hf "$AUTHED_URL"
|
| 35 |
+
git lfs push hf --all
|
| 36 |
+
git push hf "HEAD:refs/heads/${TARGET_BRANCH}" --force
|