update: code #1
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: 基础推送检验 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - dev-* | |
| - test-* | |
| - for/dev-* | |
| jobs: | |
| build-to-deploy: | |
| runs-on: macos-latest | |
| steps: | |
| - name: 检出代码库 | |
| uses: actions/checkout@v4 | |
| - name: 设置nodejs版本 | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| # - name: 缓存前端依赖 | |
| # uses: actions/cache@v3 | |
| # with: | |
| # path: frontend/node_modules | |
| # key: ${{ runner.os }}-frontend-${{ hashFiles('frontend/yarn.lock') }} | |
| - name: 缓存游戏依赖 | |
| uses: actions/cache@v3 | |
| with: | |
| path: node_modules | |
| key: ${{ runner.os }}-root-${{ hashFiles('yarn.lock') }} | |
| - name: 检查yarn工具 | |
| run: | | |
| if ! command -v yarn &> /dev/null; then | |
| npm install -g yarn | |
| fi | |
| # - name: 安装前端依赖 | |
| # run: | | |
| # cd frontend && yarn install --ignore-engines --frozen-lockfile | |
| - name: 安装游戏依赖 | |
| run: | | |
| yarn install --ignore-engines --frozen-lockfile | |
| - name: 打包测试 | |
| run: | | |
| yarn build || echo "build 脚本执行失败或不存在" | |
| # yarn bundle || echo "bundle 脚本执行失败或不存在" |