jinmao88
2023-08-10 e6c820792a22b2504c1a91de70601d685ec06d7d
.github/workflows/deploy.yml
@@ -60,6 +60,8 @@
      - name: Checkout
        uses: actions/checkout@v3
#      - uses: NullVoxPopuli/action-setup-pnpm@v2
      - name: Sed Config Base
        shell: bash
        run: |
@@ -67,22 +69,28 @@
          sed -i  "s#VITE_DROP_CONSOLE\s*=.*#VITE_DROP_CONSOLE = true#g" ./.env.production
          cat ./.env.production
      - name: Install pnpm
        uses: pnpm/action-setup@v2
        with:
          version: 8.1
          run_install: false
      - name: use Node.js 16
        uses: actions/setup-node@v3
        with:
          node-version: '16.x'
          node-version: '20.x'
      - name: Get yarn cache
        id: yarn-cache
        run: echo "::set-output name=dir::$(yarn cache dir)"
      - name: Cache dependencies
        uses: actions/cache@v3
        with:
          path: ${{ steps.yarn-cache.outputs.dir }}
          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
          restore-keys: |
            ${{ runner.os }}-yarn-
#      - name: Get yarn cache directory path
#        id: yarn-cache-dir-path
#        run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
#
#      - name: Cache dependencies
#        uses: actions/cache@v3
#        with:
#          path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
#          key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
#          restore-keys: |
#            ${{ runner.os }}-yarn-
      - name: Set SSH Environment
        env:
@@ -97,21 +105,22 @@
          git config --global user.name "vbenAdmin"
      - name: Build
        env:
          NODE_OPTIONS: '--max_old_space_size=4096'
        run: |
          yarn install
          yarn run build
          pnpm install --no-frozen-lockfile
          pnpm build
          touch dist/.nojekyll
          cp dist/index.html dist/404.html
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v2.5.0
        env:
          ACTIONS_DEPLOY_KEY: ${{secrets.ACTIONS_DEPLOY_KEY}}
          PUBLISH_BRANCH: gh-pages
          PUBLISH_DIR: ./dist
        with:
          forceOrphan: true
      - name: Delete gh-pages branch
        run: |
          git push origin --delete gh-pages
      - name: Deploy
        uses: peaceiris/actions-gh-pages@v3.9.0
        with:
          deploy_key: ${{ secrets.ACTIONS_DEPLOY_KEY }}
          PUBLISH_BRANCH: gh-pages
          PUBLISH_DIR: ./dist
          CNAME: vben.vvbin.cn