Spaces:
Sleeping
Sleeping
Commit ·
6772c98
1
Parent(s): 96b1c09
Add workflow
Browse files- .github/workflows/main.yml +44 -0
.github/workflows/main.yml
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name: Sync to Hugging Face hub
|
| 2 |
+
on:
|
| 3 |
+
push:
|
| 4 |
+
branches:
|
| 5 |
+
- '**'
|
| 6 |
+
|
| 7 |
+
# to run this workflow manually from the Actions tab
|
| 8 |
+
workflow_dispatch:
|
| 9 |
+
|
| 10 |
+
jobs:
|
| 11 |
+
sync-to-hub:
|
| 12 |
+
runs-on: ubuntu-latest
|
| 13 |
+
steps:
|
| 14 |
+
- uses: actions/checkout@v3
|
| 15 |
+
with:
|
| 16 |
+
fetch-depth: 0
|
| 17 |
+
lfs: true
|
| 18 |
+
|
| 19 |
+
- name: Install Git LFS
|
| 20 |
+
run: |
|
| 21 |
+
git lfs install
|
| 22 |
+
|
| 23 |
+
- name: Configure Git user
|
| 24 |
+
run: |
|
| 25 |
+
git config --global user.name "afshindini"
|
| 26 |
+
git config --global user.email "afshin_dini@yahoo.com"
|
| 27 |
+
|
| 28 |
+
- name: Track .pt files with Git LFS
|
| 29 |
+
run: |
|
| 30 |
+
git lfs track "*.pt"
|
| 31 |
+
git lfs ls-files
|
| 32 |
+
|
| 33 |
+
- name: Add remote
|
| 34 |
+
env:
|
| 35 |
+
HF: ${{ secrets.HG }}
|
| 36 |
+
run: git remote add space https://industoai:$HF@huggingface.co/spaces/industoai/Deep-Package-Detection
|
| 37 |
+
|
| 38 |
+
- name: Push to hub
|
| 39 |
+
env:
|
| 40 |
+
HF: ${{ secrets.HG }}
|
| 41 |
+
run: |
|
| 42 |
+
git lfs ls-files
|
| 43 |
+
git lfs push --all space
|
| 44 |
+
git push --force space ${{ github.ref }}:main
|