diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 70905d7..55d8af1 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -3,9 +3,6 @@ name: CI on: push: - branches: - - main - pull_request: workflow_dispatch: concurrency: group: 'ci' @@ -26,7 +23,7 @@ jobs: - name: 安装 pnpm uses: pnpm/action-setup@v4 with: - version: 9 + version: latest run_install: false - name: 安装 Node.js uses: actions/setup-node@v4 @@ -45,16 +42,16 @@ jobs: # https://github.com/vercel/examples/tree/main/ci-cd/github-actions # cname-cn.vercel.com cname-china.vercel-dns.com - - name: Pull Vercel Environment Information + - name: 拉取 Vercel 环境信息 run: pnpm exec vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} - - name: Build Project Artifacts + - name: 构建项目 run: pnpm exec vercel build --target=production --token=${{ secrets.VERCEL_TOKEN }} env: VITE_BUILD_COMMIT: ${{ github.sha }} - - name: Deploy Project Artifacts to Vercel + - name: 部署到 Vercel run: pnpm exec vercel deploy --prebuilt --target=production --token=${{ secrets.VERCEL_TOKEN }} - - name: Surge + - name: 部署到 Surge id: surge_deploy # pnpm exec surge token / pnpx surge token # https://github.com/Tencent/tdesign-vue-next/pull/1604#issuecomment-1236244550 @@ -62,7 +59,7 @@ jobs: run: | repository=${{github.repository}} project_name=${repository#*/} - export DEPLOY_DOMAIN=https://preview-pr${{ github.run_number }}-vue-ts-example.surge.sh + export DEPLOY_DOMAIN=https://preview-pr${{ github.run_number }}-$project_name.surge.sh cp dist/index.html dist/200.html pnpm exec surge --project ./dist --domain $DEPLOY_DOMAIN --token ${{ secrets.SURGE_TOKEN }} echo the preview URL is $DEPLOY_DOMAIN diff --git a/.npmrc b/.npmrc index 6089e60..f178a53 100644 --- a/.npmrc +++ b/.npmrc @@ -3,7 +3,7 @@ registry=https://registry.npmjs.org/ registry=https://r-npm.oo1.dev # https://pnpm.io/zh/npmrc#node-mirrorltreleasedir -#use-node-version=20.17.0 +use-node-version=20.17.0 node-mirror:release=https://npmmirror.com/mirrors/node/ node-mirror:rc=https://npmmirror.com/mirrors/node-rc/ node-mirror:nightly=https://npmmirror.com/mirrors/node-nightly/