-
-
Notifications
You must be signed in to change notification settings - Fork 3
108 lines (95 loc) · 3.44 KB
/
deploy-huggingface-spaces.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
name: Deploy to HuggingFace Spaces
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- run: |-
git clone https://$HF_USERNAME:[email protected]/spaces/moeru-ai/moonshine-web-vue --depth 1 packages/moonshine-web/dist
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ secrets.HF_USERNAME }}
- run: |-
git clone https://$HF_USERNAME:[email protected]/spaces/moeru-ai/whisper-webgpu-vue --depth 1 packages/whisper-webgpu/dist
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ secrets.HF_USERNAME }}
- run: |-
git clone https://$HF_USERNAME:[email protected]/spaces/moeru-ai/airi --depth 1 packages/stage/dist
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ secrets.HF_USERNAME }}
- uses: pnpm/action-setup@v3
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: pnpm
- run: pnpm install
- run: pnpm build
env:
TARGET_HUGGINGFACE_SPACE: 'true'
VITE_APP_TARGET_HUGGINGFACE_SPACE: 'true'
- id: moonshine_web_diff
working-directory: ./packages/moonshine-web/dist
run: |-
git lfs ls-files --all
git add .
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> "$GITHUB_OUTPUT";
fi
- if: steps.moonshine_web_diff.outputs.changes == 'true'
working-directory: ./packages/moonshine-web/dist
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ secrets.HF_USERNAME }}
run: |-
git config --local user.email "[email protected]"
git config --local user.name "Neko Ayaka"
git commit -m "release: build ${{ github.sha }}"
git lfs push origin main --all
git push -f
- id: whisper_webgpu_diff
working-directory: ./packages/whisper-webgpu/dist
run: |-
git lfs ls-files --all
git add .
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> "$GITHUB_OUTPUT";
fi
- if: steps.whisper_webgpu_diff.outputs.changes == 'true'
working-directory: ./packages/whisper-webgpu/dist
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ secrets.HF_USERNAME }}
run: |-
git config --local user.email "[email protected]"
git config --local user.name "Neko Ayaka"
git commit -m "release: build ${{ github.sha }}"
git lfs push origin main --all
git push -f
- id: airi_diff
working-directory: ./packages/stage/dist
run: |-
git lfs ls-files --all
git add .
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> "$GITHUB_OUTPUT";
fi
- if: steps.airi_diff.outputs.changes == 'true'
working-directory: ./packages/stage/dist
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_USERNAME: ${{ secrets.HF_USERNAME }}
run: |-
git config --local user.email "[email protected]"
git config --local user.name "Neko Ayaka"
git commit -m "release: build ${{ github.sha }}"
git lfs push origin main --all
git push -f