Archisman Karmakar
commited on
Update deploy_to_HF_space.yml
Browse files
.github/workflows/deploy_to_HF_space.yml
CHANGED
|
@@ -10,8 +10,6 @@ on:
|
|
| 10 |
|
| 11 |
jobs:
|
| 12 |
deploy-to-hf:
|
| 13 |
-
# permissions:
|
| 14 |
-
# pull-requests: write
|
| 15 |
runs-on: ubuntu-latest
|
| 16 |
|
| 17 |
steps:
|
|
@@ -35,24 +33,12 @@ jobs:
|
|
| 35 |
- name: Upgrade pip
|
| 36 |
run: python -m pip install --upgrade pip
|
| 37 |
|
| 38 |
-
|
| 39 |
- name: Install dependencies
|
| 40 |
run: |
|
| 41 |
echo "Python version:"
|
| 42 |
python --version
|
| 43 |
|
| 44 |
pip install -r requirements.txt
|
| 45 |
-
|
| 46 |
-
# Install from requirements.txt if available
|
| 47 |
-
# if [ -f requirements.txt ]; then
|
| 48 |
-
# echo "Installing from requirements.txt"
|
| 49 |
-
# pip install -r requirements.txt
|
| 50 |
-
# fi
|
| 51 |
-
# Optionally install the package using pyproject.toml if needed
|
| 52 |
-
# if [ -f pyproject.toml ]; then
|
| 53 |
-
# echo "Installing package via pyproject.toml"
|
| 54 |
-
# pip install .
|
| 55 |
-
# fi
|
| 56 |
|
| 57 |
- name: Install Hugging Face CLI
|
| 58 |
run: pip install huggingface_hub
|
|
@@ -62,23 +48,16 @@ jobs:
|
|
| 62 |
git config --global user.email "actions@github.com"
|
| 63 |
git config --global user.name "GitHub Actions"
|
| 64 |
|
| 65 |
-
# - name: Clone Hugging Face Space
|
| 66 |
-
# run: huggingface-cli repo clone \
|
| 67 |
-
# YOUR_HF_USERNAME/SPACE_NAME \
|
| 68 |
-
# --token "${{ secrets.HF_READ_WRITE_TOKEN }}" \
|
| 69 |
-
# --branch main \
|
| 70 |
-
# hf-space
|
| 71 |
-
|
| 72 |
- name: Clone Hugging Face Space repository
|
| 73 |
run: |
|
| 74 |
-
git clone https://HF_USERNAME:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/tachygraphy-microtrext-norm-org/Tachygraphy-Microtext-Analysis-and-Normalization-ArchismanCoder
|
| 75 |
-
|
| 76 |
|
| 77 |
- name: Copy repository files to HF Space
|
| 78 |
run: |
|
| 79 |
-
# Remove the .git folder
|
| 80 |
rm -rf hf-space/.git
|
| 81 |
-
|
|
|
|
| 82 |
|
| 83 |
- name: Commit and push to Hugging Face
|
| 84 |
run: |
|
|
|
|
| 10 |
|
| 11 |
jobs:
|
| 12 |
deploy-to-hf:
|
|
|
|
|
|
|
| 13 |
runs-on: ubuntu-latest
|
| 14 |
|
| 15 |
steps:
|
|
|
|
| 33 |
- name: Upgrade pip
|
| 34 |
run: python -m pip install --upgrade pip
|
| 35 |
|
|
|
|
| 36 |
- name: Install dependencies
|
| 37 |
run: |
|
| 38 |
echo "Python version:"
|
| 39 |
python --version
|
| 40 |
|
| 41 |
pip install -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
|
| 43 |
- name: Install Hugging Face CLI
|
| 44 |
run: pip install huggingface_hub
|
|
|
|
| 48 |
git config --global user.email "actions@github.com"
|
| 49 |
git config --global user.name "GitHub Actions"
|
| 50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
- name: Clone Hugging Face Space repository
|
| 52 |
run: |
|
| 53 |
+
git clone https://HF_USERNAME:${{ secrets.HF_TOKEN }}@huggingface.co/spaces/tachygraphy-microtrext-norm-org/Tachygraphy-Microtext-Analysis-and-Normalization-ArchismanCoder hf-space
|
|
|
|
| 54 |
|
| 55 |
- name: Copy repository files to HF Space
|
| 56 |
run: |
|
| 57 |
+
# Remove the .git folder from the cloned HF Space repository
|
| 58 |
rm -rf hf-space/.git
|
| 59 |
+
# Use rsync to copy all files except the hf-space directory to avoid copying the clone into itself
|
| 60 |
+
rsync -av --exclude='hf-space' ./ hf-space/
|
| 61 |
|
| 62 |
- name: Commit and push to Hugging Face
|
| 63 |
run: |
|