From 03506ac89752c5ce9b84011398a4c430a4dce3a7 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Thu, 26 Dec 2024 03:27:59 +0800 Subject: [PATCH] chore(ci): deploy airi --- .../workflows/deploy-huggingface-spaces.yml | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/.github/workflows/deploy-huggingface-spaces.yml b/.github/workflows/deploy-huggingface-spaces.yml index 2c9ab673f..1ef595f04 100644 --- a/.github/workflows/deploy-huggingface-spaces.yml +++ b/.github/workflows/deploy-huggingface-spaces.yml @@ -26,6 +26,12 @@ jobs: 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: @@ -74,3 +80,23 @@ jobs: 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