Hasan Iqbal
commited on
Fixed Enable/Disable feature for HF Spaces config
Browse files- .github/workflows/main.yaml +13 -14
- scripts/spaces.sh +0 -16
.github/workflows/main.yaml
CHANGED
@@ -9,28 +9,27 @@ jobs:
|
|
9 |
huggingface_deploy:
|
10 |
name: Deploy to Hugging Face
|
11 |
runs-on: ubuntu-latest
|
12 |
-
if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
|
13 |
steps:
|
14 |
-
-
|
|
|
15 |
with:
|
|
|
16 |
fetch-depth: 0
|
17 |
-
|
18 |
-
- name:
|
19 |
run: |
|
20 |
-
READMEFILE="README.md"
|
21 |
-
|
22 |
-
if [[ "$OSTYPE" == "darwin"* ]]; then
|
23 |
-
sed -i '' 's/<!--/---/g; s/-->/---/g' $READMEFILE
|
24 |
-
else
|
25 |
-
sed -i 's/<!--/---/g; s/-->/---/g' $READMEFILE
|
26 |
-
fi
|
27 |
-
|
28 |
git config --global user.email "[email protected]"
|
29 |
git config --global user.name "Hasan Iqbal"
|
30 |
|
|
|
|
|
|
|
|
|
31 |
git add $READMEFILE
|
32 |
-
git commit -m "Uncommented HuggingFace Spaces Configuration"
|
|
|
33 |
- name: Push to Hugging Face
|
34 |
env:
|
35 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
36 |
-
run: git push https://hasaniqbal777:[email protected]/spaces/hasaniqbal777/OpenFactCheck
|
|
|
9 |
huggingface_deploy:
|
10 |
name: Deploy to Hugging Face
|
11 |
runs-on: ubuntu-latest
|
12 |
+
#if: ${{ github.ref_type == 'tag' && startsWith(github.ref_name, 'v') }}
|
13 |
steps:
|
14 |
+
- name: Check out code
|
15 |
+
uses: actions/checkout@v3
|
16 |
with:
|
17 |
+
ref: ${{ github.head_ref }}
|
18 |
fetch-depth: 0
|
19 |
+
|
20 |
+
- name: Setup Git Config
|
21 |
run: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22 |
git config --global user.email "[email protected]"
|
23 |
git config --global user.name "Hasan Iqbal"
|
24 |
|
25 |
+
- name: Enable HuggingFace Spaces Config
|
26 |
+
run: |
|
27 |
+
READMEFILE="README.md"
|
28 |
+
sed -i 's/<!--/---/g; s/-->/---/g' $READMEFILE
|
29 |
git add $READMEFILE
|
30 |
+
git commit -m "Uncommented HuggingFace Spaces Configuration" || echo "No changes to commit"
|
31 |
+
|
32 |
- name: Push to Hugging Face
|
33 |
env:
|
34 |
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
35 |
+
run: git push https://hasaniqbal777:[email protected]/spaces/hasaniqbal777/OpenFactCheck --force
|
scripts/spaces.sh
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
|
3 |
-
source "${BASH_SOURCE%/*}/common.sh"
|
4 |
-
|
5 |
-
READMEFILE="README.md"
|
6 |
-
|
7 |
-
# Replace "<!--" and "-->" with "---" in README.md file
|
8 |
-
if [[ "$OSTYPE" == "darwin"* ]]; then
|
9 |
-
sed -i '' 's/<!--/---/g; s/-->/---/g' $READMEFILE
|
10 |
-
else
|
11 |
-
sed -i 's/<!--/---/g; s/-->/---/g' $READMEFILE
|
12 |
-
fi
|
13 |
-
|
14 |
-
# Commit changes
|
15 |
-
git add $READMEFILE
|
16 |
-
git commit -m "Uncommented HuggingFace Spaces Configuration"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|