diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml index 20cf594..44d1eaa 100644 --- a/.github/workflows/webpack.yml +++ b/.github/workflows/webpack.yml @@ -10,31 +10,24 @@ jobs: build: runs-on: ubuntu-latest - strategy: - matrix: - node-version: [20.x] - steps: - - uses: actions/checkout@v3 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 + - name: Checkout 🛎️ + uses: actions/checkout@master with: - node-version: ${{ matrix.node-version }} + persist-credentials: false - - name: Install dependencies + - name: Install 🔧 run: | npm install -g pnpm pnpm install - - name: Build project - run: pnpm run build:h5 - - - name: Deploy on master branch - if: github.ref == 'refs/heads/master' && github.event_name == 'push' && github.event.pull_request == null + - name: Build 🏗️ run: | - export COMMIT_MSG="$(git log --format='%h - %B' --no-merges -n 1)" - export COMMIT_USER="$(git log --no-merges -n 1 --format=%an)" - export COMMIT_EMAIL="$(git log --no-merges -n 1 --format=%ae)" - export ROT_TOKEN="${{ secrets.GITHUB_TOKEN }}" - sh build/deploy-ci.sh + pnpm run build:h5 + + - name: Deploy to GH Pages 🚀 + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: dist + cname: taro.w3cub.com diff --git a/build/deploy-ci.sh b/build/deploy-ci.sh deleted file mode 100644 index 67c0a14..0000000 --- a/build/deploy-ci.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -mkdir temp_web -git config --global user.name "Terry Rot" -git config --global user.email "gidcai@gmail.com" - -if [ "$ROT_TOKEN" = "" ]; then - echo "Bye~" - exit 0 -fi - -echo taro.w3cub.com >> dist/CNAME - -cd temp_web -git clone --depth 1 -b gh-pages --single-branch https://$ROT_TOKEN@github.com/icai/taro-cnode.git && cd taro-cnode - - -cp -rf ../../dist/** . -cp -rf ../../README.md . -git add -A . -git commit -m "$COMMIT_MSG" -git push origin gh-pages -cd ../.. - -echo "DONE, Bye~" -exit 0