alexdum commited on
Commit
280d55e
·
1 Parent(s): 2dcbefc

synchronize with hugging face

Browse files
Files changed (2) hide show
  1. .github/workflows/sync-to-hub.yml +55 -0
  2. README.md +10 -0
.github/workflows/sync-to-hub.yml ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Sync to Hugging Face Hub
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ sync-to-hub:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ # Step 1: Checkout the repository with full history and LFS support
13
+ - uses: actions/checkout@v3
14
+ with:
15
+ fetch-depth: 0
16
+ lfs: true
17
+
18
+ # Step 2: Configure Git User (necessary for commits)
19
+ - name: Configure Git User
20
+ run: |
21
+ git config --global user.email "alexandru.dumitrescu@gmail.com"
22
+ git config --global user.name "alexdum"
23
+
24
+ # Step 3: Track .nc Files with Git LFS if not already tracked
25
+ - name: Track .nc Files with Git LFS
26
+ run: |
27
+ if ! grep -q "*.nc" .gitattributes; then
28
+ git lfs track "*.nc"
29
+ git add .gitattributes
30
+ git commit -m "Configure Git LFS for all .nc files"
31
+ fi
32
+
33
+ # Step 4: Add and Commit Any LFS-tracked Files (only if there are changes)
34
+ - name: Add and Commit LFS-tracked Files
35
+ run: |
36
+ git add .
37
+ git diff-index --quiet HEAD || git commit -m "Move .nc files to Git LFS"
38
+
39
+ # Step 5: Verify LFS Tracking
40
+ - name: Verify LFS Tracking
41
+ run: git lfs ls-files
42
+
43
+ # Step 6: Add Hugging Face Remote
44
+ - name: Add Hugging Face Remote
45
+ env:
46
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
47
+ run: |
48
+ git remote add hf https://alexdum:${HF_TOKEN}@huggingface.co/spaces/alexdum/ghcnh
49
+
50
+ # Step 7: Force Push to Hugging Face Hub
51
+ - name: Force Push to Hugging Face Hub
52
+ env:
53
+ HF_TOKEN: ${{ secrets.HF_TOKEN }}
54
+ run: |
55
+ git push hf main --force
README.md ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: ghcnh
3
+ emoji: 📚
4
+ colorFrom: blue
5
+ colorTo: yellow
6
+ sdk: docker
7
+ pinned: false
8
+ ---
9
+
10
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference