barreloflube commited on
Commit
63ede51
·
1 Parent(s): d220d8d

refactor: Simplify Hugging Face deployment workflow

Browse files
Files changed (1) hide show
  1. .github/workflows/main.yml +6 -24
.github/workflows/main.yml CHANGED
@@ -7,26 +7,16 @@ on:
7
  workflow_dispatch:
8
 
9
  jobs:
10
- build-and-sync-to-hub:
11
  runs-on: ubuntu-latest
12
  steps:
13
- - name: Checkout code
14
  uses: actions/checkout@v3
15
  with:
 
16
  fetch-depth: 0
17
  lfs: true
18
 
19
- - name: Setup Bun
20
- uses: oven-sh/setup-bun@v1
21
- with:
22
- bun-version: latest
23
-
24
- - name: Install dependencies
25
- run: bun install
26
-
27
- - name: Build app
28
- run: bun run build
29
-
30
  - name: Update README for Hugging Face Space
31
  run: |
32
  cat > README.md << 'EOL'
@@ -67,27 +57,19 @@ jobs:
67
 
68
  ## Development
69
 
70
- This Space is automatically updated via GitHub Actions from the repository. Any changes pushed to the main branch are automatically built and deployed to this Space.
71
 
72
  ## License
73
 
74
  See LICENSE file for details.
75
  EOL
76
 
77
- - name: Prepare for Hugging Face
78
- run: |
79
- # Create a .gitignore specifically for the HF Space
80
- echo "node_modules/" > .hugginface.gitignore
81
- # Move the dist content to a directory that's not ignored
82
- mkdir -p static
83
- cp -r dist/* static/
84
-
85
  - name: Push to Hugging Face Hub
86
  env:
87
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
88
  run: |
89
  git config --global user.email "github-actions[bot]@users.noreply.github.com"
90
  git config --global user.name "GitHub Actions"
91
- git add README.md static/
92
- git commit -m "Update build and README for Hugging Face Space"
93
  git push https://mantrakp:[email protected]/spaces/mantrakp/sheer main:main
 
7
  workflow_dispatch:
8
 
9
  jobs:
10
+ sync-to-hub:
11
  runs-on: ubuntu-latest
12
  steps:
13
+ - name: Checkout gh-pages branch
14
  uses: actions/checkout@v3
15
  with:
16
+ ref: gh-pages
17
  fetch-depth: 0
18
  lfs: true
19
 
 
 
 
 
 
 
 
 
 
 
 
20
  - name: Update README for Hugging Face Space
21
  run: |
22
  cat > README.md << 'EOL'
 
57
 
58
  ## Development
59
 
60
+ This Space is automatically updated via GitHub Actions from the repository. The gh-pages branch is directly pushed to this Space.
61
 
62
  ## License
63
 
64
  See LICENSE file for details.
65
  EOL
66
 
 
 
 
 
 
 
 
 
67
  - name: Push to Hugging Face Hub
68
  env:
69
  HF_TOKEN: ${{ secrets.HF_TOKEN }}
70
  run: |
71
  git config --global user.email "github-actions[bot]@users.noreply.github.com"
72
  git config --global user.name "GitHub Actions"
73
+ git add README.md
74
+ git commit -m "Update README for Hugging Face Space"
75
  git push https://mantrakp:[email protected]/spaces/mantrakp/sheer main:main