chore(deps): lock file maintenance #1396
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Deploy game | |
| on: | |
| # make sure this is the branch you are using | |
| push: | |
| branches: | |
| - master | |
| - dev-game | |
| paths: | |
| - "game/**" | |
| - ".github/workflows/deploy-game.yml" | |
| - "**/package.json" | |
| - "**/pnpm-lock.yaml" | |
| # 手动触发部署 | |
| # workflow_dispatch: | |
| pull_request: | |
| branches: | |
| - master | |
| - dev-game | |
| paths: | |
| - "game/**" | |
| - ".github/workflows/deploy-game.yml" | |
| - "**/package.json" | |
| - "**/pnpm-lock.yaml" | |
| permissions: | |
| contents: write | |
| jobs: | |
| deploy-game: | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] # macos-latest, windows-latest | |
| deploy-dir: [game/.vitepress/dist] | |
| deploy-user: [augusmeow] | |
| deploy-repo: [game] | |
| runs-on: ${{ matrix.os }} | |
| # # only me, deploy | |
| # if: github.actor == 'DrAugus' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| # “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 | |
| fetch-depth: 0 | |
| # if your docs needs submodules, uncomment the following line | |
| # submodules: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| - uses: pnpm/action-setup@v4.2.0 | |
| name: Install pnpm | |
| id: pnpm-install | |
| # with: # Install only pnpm with packageManager | |
| # version: 7 | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| # 运行构建脚本 | |
| - name: Build VuePress site | |
| env: | |
| BASE: / | |
| HOSTNAME: https://draugus.github.io/ | |
| NODE_OPTIONS: --max_old_space_size=4096 | |
| run: pnpm game:build | |
| # 防止加载不到 _开头的文件 下面已经有了 jekyll: false | |
| # @see https://github.com/orgs/github-community/discussions/19794 | |
| # - name: Add nojekyll | |
| # run: | | |
| # cd .vitepress/dist | |
| # touch .nojekyll | |
| # 查看 workflow 的文档来获取更多信息 | |
| # @see https://github.com/crazy-max/ghaction-github-pages | |
| # @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret | |
| # current repo | |
| - name: Deploy to GitHub Pages Home Site | |
| uses: crazy-max/ghaction-github-pages@v4.2.0 | |
| with: | |
| build_dir: ${{ matrix.deploy-dir }} | |
| jekyll: false | |
| env: | |
| GH_PAT: ${{ secrets.DEPLOY_GH }} | |
| - name: Change config.ts | |
| run: mv ./game/.vitepress/config.ts.example ./game/.vitepress/config.ts | |
| - name: Build VuePress site again | |
| env: | |
| BASE: /game/ | |
| HOSTNAME: https://augusmeow.github.io/ | |
| NODE_OPTIONS: --max_old_space_size=4096 | |
| run: pnpm game:build | |
| - name: Deploy to GitHub Pages in augusmeow | |
| uses: crazy-max/ghaction-github-pages@v4.2.0 | |
| with: | |
| repo: ${{ matrix.deploy-user }}/${{ matrix.deploy-repo }} | |
| target_branch: gh-pages | |
| build_dir: ${{ matrix.deploy-dir }} | |
| jekyll: false | |
| env: | |
| GH_PAT: ${{ secrets.DEPLOY_GH }} |