UdasriHasindu commited on
Commit
a2a05f0
·
1 Parent(s): b92c22f

fix action 3

Browse files
Files changed (1) hide show
  1. .github/workflows/deploy.yml +28 -20
.github/workflows/deploy.yml CHANGED
@@ -1,24 +1,32 @@
1
- - name: Push to Hugging Face Hub
2
- env:
3
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
4
- HF_USERNAME: xplorers
5
- SPACE_NAME: MIS_API
6
- run: |
7
- set -euo pipefail
8
 
9
- - name: Push to Hugging Face Hub
10
- env:
11
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
12
- HF_USERNAME: xplorers
13
- SPACE_NAME: MIS_API
14
- run: |
15
- set -euo pipefail
16
 
17
- # Strip possible CR/LF just in case the secret was pasted with a trailing newline
18
- HF_TOKEN="$(printf '%s' "$HF_TOKEN" | tr -d '\r\n')"
 
 
 
 
 
 
19
 
20
- git remote remove hf 2>/dev/null || remote="https://huggingface.co/spaces/${HF_USERNAME}/${SPACE_NAME}"
 
 
 
 
 
 
21
 
22
- # Use the token via HTTP header (no URL parsing issues)
23
- git -c http.extraheader="Authorization: Bearer ${HF_TOKEN}" \
24
- push --force "${remote}" HEAD:main
 
 
 
 
 
 
1
+ name: Deploy to Hugging Face
 
 
 
 
 
 
2
 
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
 
 
 
7
 
8
+ jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout repository
13
+ uses: actions/checkout@v4
14
+ with:
15
+ fetch-depth: 0
16
 
17
+ - name: Push to Hugging Face Hub
18
+ env:
19
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
20
+ HF_USERNAME: xplorers
21
+ SPACE_NAME: MIS_API
22
+ run: |
23
+ set -euo pipefail
24
 
25
+ # Strip possible CR/LF just in case the secret was pasted with a trailing newline
26
+ HF_TOKEN="$(printf '%s' "$HF_TOKEN" | tr -d '\r\n')"
27
+
28
+ remote="https://huggingface.co/spaces/${HF_USERNAME}/${SPACE_NAME}"
29
+
30
+ # Use the token via HTTP header (no URL parsing issues)
31
+ git -c http.extraheader="Authorization: Bearer ${HF_TOKEN}" \
32
+ push --force "${remote}" HEAD:main