Playwright Tests
Some checks are pending
CI / cache-and-install (push) Waiting to run

This commit is contained in:
严浩
2024-09-26 12:12:06 +08:00
parent 762d035f38
commit 34d1ebc3eb
2 changed files with 4 additions and 4 deletions

66
.github/workflows/ci.yaml vendored Normal file
View File

@ -0,0 +1,66 @@
# https://cn.vitejs.dev/guide/static-deploy
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: 'ci'
cancel-in-progress: true
jobs:
cache-and-install:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- run: sed -i '/use-node-version/d' .npmrc
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Lint
run: pnpm lint
# - name: Build
# run: pnpm build
# env:
# VITE_BUILD_COMMIT: ${{ github.sha }}
# https://github.com/vercel/examples/tree/main/ci-cd/github-actions
# cname-china.vercel-dns.com
# cname-cn.vercel.com
# - name: Install Vercel CLI
# run: npm install --global vercel@canary
- name: Pull Vercel Environment Information
run: pnpx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
- name: Build Project Artifacts
run: pnpx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
env:
VITE_BUILD_COMMIT: ${{ github.sha }}
- name: Deploy Project Artifacts to Vercel
run: pnpx vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
# https://github.com/Tencent/tdesign-vue-next/pull/1604#issuecomment-1236244550
- name: Surge
# pnpx surge token
run: |
cp dist/index.html dist/200.html
pnpx surge dist https://vue-ts-example.surge.sh --token ${{ secrets.SURGE_TOKEN }}

View File

@ -1,9 +1,9 @@
name: Playwright Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
workflow_run:
workflows: ['CI'] # 这里的名称应该是你的 `ci.yaml` 中定义的工作流名称
types:
- completed
jobs:
test:
timeout-minutes: 60