wony617 commited on
Commit
b090494
Β·
1 Parent(s): 8068fb0

Add github action for deployment to space

Browse files
Files changed (3) hide show
  1. .github/workflows/main.yml +40 -0
  2. .gitignore +2 -0
  3. README.md +12 -0
.github/workflows/main.yml ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Deploy to HF Space
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ deploy:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout repository
14
+ uses: actions/checkout@v3
15
+ with:
16
+ fetch-depth: 0
17
+ lfs: true
18
+
19
+ - name: Setup LFS & migrate images
20
+ run: |
21
+ git config --global user.email "actions@github.com"
22
+ git config --global user.name "GitHub Actions"
23
+ git lfs install
24
+ git lfs track "images/**"
25
+ echo "images/** filter=lfs diff=lfs merge=lfs -text" >> .gitattributes
26
+ git add .gitattributes
27
+ git commit -m "Add images to LFS tracking" || echo "No changes"
28
+ # Ensure working directory is clean
29
+ git add -A
30
+ git diff --cached --quiet || git commit -m "Pre-migrate: commit all changes" || echo "No changes"
31
+ git lfs migrate import --include="images/**" --include-ref=refs/heads/main
32
+
33
+ - name: Deploy to Hugging Face Space
34
+ env:
35
+ HF_USERNAME: ${{ secrets.HF_USERNAME }}
36
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
37
+ HF_SPACE_NAME: ${{ secrets.HF_SPACE_NAME }}
38
+ run: |
39
+ git remote add space https://$HF_USERNAME:$HF_TOKEN@huggingface.co/spaces/$HF_USERNAME/$HF_SPACE_NAME
40
+ git push --force space main
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ .env
2
+ */__pycache__/
README.md CHANGED
@@ -1,3 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
  <div align="center">
2
 
3
  # 🌐 [i18n-agent] Hugging Face i18n made easy
 
1
+ ---
2
+ title: i18n Agent - Contribute in Just 5 Minutes
3
+ emoji: πŸ€—
4
+ colorFrom: yellow
5
+ colorTo: yellow
6
+ sdk: gradio
7
+ sdk_version: 5.33.1
8
+ app_file: app.py
9
+ pinned: false
10
+ ---
11
+
12
+
13
  <div align="center">
14
 
15
  # 🌐 [i18n-agent] Hugging Face i18n made easy