Spaces:
Paused
Paused
Commit ·
fe48307
1
Parent(s): caca973
fix: update Hugging Face deployment workflow to improve script execution and formatting
Browse files
.github/workflows/deploy-to-hf.yml
CHANGED
|
@@ -13,6 +13,8 @@ jobs:
|
|
| 13 |
steps:
|
| 14 |
- name: Checkout
|
| 15 |
uses: actions/checkout@v4
|
|
|
|
|
|
|
| 16 |
|
| 17 |
- name: Configure Git
|
| 18 |
run: |
|
|
@@ -27,3 +29,11 @@ jobs:
|
|
| 27 |
HF_SPACE_REPO="https://huggingface.co/spaces/danilonovais/n8n-dan"
|
| 28 |
git remote add hf "https://user:${HF_TOKEN}@${HF_SPACE_REPO#https://}"
|
| 29 |
git push hf HEAD:main --force
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
steps:
|
| 14 |
- name: Checkout
|
| 15 |
uses: actions/checkout@v4
|
| 16 |
+
with:
|
| 17 |
+
fetch-depth: 0
|
| 18 |
|
| 19 |
- name: Configure Git
|
| 20 |
run: |
|
|
|
|
| 29 |
HF_SPACE_REPO="https://huggingface.co/spaces/danilonovais/n8n-dan"
|
| 30 |
git remote add hf "https://user:${HF_TOKEN}@${HF_SPACE_REPO#https://}"
|
| 31 |
git push hf HEAD:main --force
|
| 32 |
+
- name: Trigger Space build
|
| 33 |
+
env:
|
| 34 |
+
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 35 |
+
HF_SPACE_ID: danilonovais/n8n-dan
|
| 36 |
+
run: |
|
| 37 |
+
curl -X POST \
|
| 38 |
+
-H "Authorization: Bears " \
|
| 39 |
+
https://huggingface.co/api/spaces//build
|
n8n-infra/.github/workflows/deploy-to-hf.yml
CHANGED
|
@@ -50,14 +50,15 @@ jobs:
|
|
| 50 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 51 |
HF_SPACE_ID: ${{ secrets.HF_SPACE_ID }}
|
| 52 |
run: |
|
| 53 |
-
|
| 54 |
import os
|
| 55 |
from huggingface_hub import HfApi
|
| 56 |
|
| 57 |
-
token = os.environ[
|
| 58 |
-
space = os.environ[
|
| 59 |
api = HfApi(token=token)
|
| 60 |
api.restart_space(repo_id=space)
|
| 61 |
-
print(f
|
| 62 |
-
|
|
|
|
| 63 |
|
|
|
|
| 50 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
| 51 |
HF_SPACE_ID: ${{ secrets.HF_SPACE_ID }}
|
| 52 |
run: |
|
| 53 |
+
echo "
|
| 54 |
import os
|
| 55 |
from huggingface_hub import HfApi
|
| 56 |
|
| 57 |
+
token = os.environ['HF_TOKEN']
|
| 58 |
+
space = os.environ['HF_SPACE_ID']
|
| 59 |
api = HfApi(token=token)
|
| 60 |
api.restart_space(repo_id=space)
|
| 61 |
+
print(f'Restart requested for Space: {space}')
|
| 62 |
+
" > restart_space.py
|
| 63 |
+
python3 restart_space.py
|
| 64 |
|