Files
moeka-project/.github/workflows/deploy-huggingface-spaces.yml
T

103 lines
3.2 KiB
YAML

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:$HF_TOKEN@huggingface.co/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:$HF_TOKEN@huggingface.co/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:$HF_TOKEN@huggingface.co/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
- id: moonshine_web_diff
working-directory: ./packages/moonshine-web/dist
run: |-
mv ../README.md .
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 "neko@ayaka.moe"
git config --local user.name "Neko Ayaka"
git commit -m "release: build ${{ github.sha }}"
git push -f
- id: whisper_webgpu_diff
working-directory: ./packages/whisper-webgpu/dist
run: |-
mv ../README.md .
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 "neko@ayaka.moe"
git config --local user.name "Neko Ayaka"
git commit -m "release: build ${{ github.sha }}"
git push -f
# - id: airi_diff
# working-directory: ./packages/stage/dist
# run: |-
# mv ../README.md .
# 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 "neko@ayaka.moe"
# git config --local user.name "Neko Ayaka"
# git commit -m "release: build ${{ github.sha }}"
# git push -f