kohlin commited on
Commit
d71a1fa
·
1 Parent(s): 4fe4d99

Update hf-deploy.yml

Browse files
Files changed (1) hide show
  1. .github/workflows/hf-deploy.yml +10 -8
.github/workflows/hf-deploy.yml CHANGED
@@ -1,6 +1,5 @@
1
  name: Deploy to Hugging Face Spaces
2
 
3
- # Trigger this workflow on pushes to the main branch.
4
  on:
5
  push:
6
  branches:
@@ -18,25 +17,28 @@ jobs:
18
  git config --global user.name "GitHub Actions"
19
  git config --global user.email "actions@github.com"
20
 
21
- - name: Clone Hugging Face Space Repository
22
  env:
23
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
24
- HF_REPO: kohlin/nlp-spacy # Replace with your Hugging Face Space repo name.
25
  run: |
26
- # Clone the HF space repo into a folder named "space-repo"
27
- git clone https://${HF_TOKEN}:@huggingface.co/${HF_REPO}.git space-repo
 
 
 
 
 
 
28
 
29
  - name: Copy Files to Hugging Face Space Repo
30
  run: |
31
- # Copy all files from the current repo into the space repo folder (excluding .git)
32
  rsync -av --exclude='.git' ./ space-repo/
33
 
34
  - name: Commit and Push Changes to Hugging Face Space
35
  env:
36
- HF_TOKEN: ${{ secrets.HF_TOKEN }}
37
  HF_REPO: kohlin/nlp-spacy
38
  run: |
39
  cd space-repo
40
  git add .
41
  git commit -m "Deploy updated app from GitHub Actions" || echo "No changes to commit"
42
- git push https://${HF_TOKEN}:@huggingface.co/${HF_REPO}.git
 
1
  name: Deploy to Hugging Face Spaces
2
 
 
3
  on:
4
  push:
5
  branches:
 
17
  git config --global user.name "GitHub Actions"
18
  git config --global user.email "actions@github.com"
19
 
20
+ - name: Setup .netrc for Hugging Face Authentication
21
  env:
22
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
 
23
  run: |
24
+ echo "machine huggingface.co login ${HF_TOKEN} password x" > ~/.netrc
25
+ chmod 600 ~/.netrc
26
+
27
+ - name: Clone Hugging Face Space Repository
28
+ env:
29
+ HF_REPO: kohlin/nlp-spacy # Replace with your Hugging Face Space repository name.
30
+ run: |
31
+ git clone https://huggingface.co/${HF_REPO}.git space-repo
32
 
33
  - name: Copy Files to Hugging Face Space Repo
34
  run: |
 
35
  rsync -av --exclude='.git' ./ space-repo/
36
 
37
  - name: Commit and Push Changes to Hugging Face Space
38
  env:
 
39
  HF_REPO: kohlin/nlp-spacy
40
  run: |
41
  cd space-repo
42
  git add .
43
  git commit -m "Deploy updated app from GitHub Actions" || echo "No changes to commit"
44
+ git push https://huggingface.co/${HF_REPO}.git