mirror of
https://github.com/moeru-ai/airi-factorio.git
synced 2025-09-04 17:02:04 +00:00
ci(yolo-playground): add deploy
This commit is contained in:
52
.github/workflows/deploy-hf-space.yml
vendored
Normal file
52
.github/workflows/deploy-hf-space.yml
vendored
Normal file
@@ -0,0 +1,52 @@
|
||||
name: HuggingFace Spaces
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: 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/proj-airi/factorio-yolo-v0-playground --depth 1 apps/factorio-yolo-v0-playground/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: airi_diff
|
||||
working-directory: ./apps/factorio-yolo-v0-playground/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: ./apps/factorio-yolo-v0-playground/dist
|
||||
env:
|
||||
HF_TOKEN: ${{ secrets.HF_TOKEN }}
|
||||
HF_USERNAME: ${{ secrets.HF_USERNAME }}
|
||||
run: |-
|
||||
git config --local user.email "self@lemonneko.moe"
|
||||
git config --local user.name "LemonNeko"
|
||||
git commit -m "release: build ${{ github.sha }}"
|
||||
git lfs push origin main --all
|
||||
git push -f
|
Reference in New Issue
Block a user