diff --git a/.github/workflows/auto_build.yml b/.github/workflows/auto_build.yml new file mode 100644 index 0000000..13fb9c9 --- /dev/null +++ b/.github/workflows/auto_build.yml @@ -0,0 +1,38 @@ +name: 自动构建并上传 + +on: + push: + branches: [ "main" ] + +jobs: + main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + token: ${{ secrets.GH_TOKEN }} + + - uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install and Build + run: | + yarn + yarn run build + + - name: Commit zhenun_docs + run: | + git checkout --orphan zhenxun_docs + mv build ../ + rm -rf ./.github ./.gitignore ./* + mv ../build/* ./ + git config --local user.email 'l1040186796@gmail.com' + git config --local user.name 'AkashiCoin' + git add . + git commit -m ":book: chore(zhenxun_docs): 自动构建文档" + + - name: Upload dist files + run: | + git remote set-url origin https://HibiKier:${{ secrets.GH_TOKEN }}@github.com/HibiKier/zhenxun_bot.git + git push origin zhenxun_docs --force \ No newline at end of file