Mostafa174 commited on
Commit
75f057a
·
1 Parent(s): 031a711
Files changed (1) hide show
  1. .github/workflows/deploy_to_hf.yml +16 -4
.github/workflows/deploy_to_hf.yml CHANGED
@@ -5,19 +5,31 @@ on:
5
  branches:
6
  - main
7
  workflow_dispatch:
 
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
 
17
  - name: Push to Hugging Face Space
18
  env:
19
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
  run: |
 
 
 
21
  git remote remove space 2>/dev/null || true
22
- git remote add space https://huggingface.co/spaces/Mostafa174/Topic_Modeling_AI
23
- git push --force https://$HF_TOKEN@huggingface.co/spaces/Mostafa174/Topic_Modeling_AI
 
 
 
5
  branches:
6
  - main
7
  workflow_dispatch:
8
+
9
  jobs:
10
  sync-to-hub:
11
  runs-on: ubuntu-latest
12
  steps:
13
+ - name: Checkout repo
14
+ uses: actions/checkout@v3
15
  with:
 
16
  lfs: true
17
+ fetch-depth: 0
18
+
19
+ - name: Set up git
20
+ run: |
21
+ git config --global user.email "actions@github.com"
22
+ git config --global user.name "GitHub Actions"
23
 
24
  - name: Push to Hugging Face Space
25
  env:
26
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
27
  run: |
28
+ SPACE_URL="https://huggingface.co/spaces/Mostafa174/Topic_Modeling_AI"
29
+
30
+ # Clean remote if it already exists
31
  git remote remove space 2>/dev/null || true
32
+ git remote add space $SPACE_URL
33
+
34
+ # Push securely using token
35
+ git push --force https://$HF_TOKEN@huggingface.co/spaces/Mostafa174/Topic_Modeling_AI HEAD:main