Files
vue-ts-example/.github/workflows/playwright.yaml
mini2024 fbff6e0542
Some checks failed
/ build-and-deploy-to-vercel (push) Successful in 2m42s
/ lint-build-and-check (push) Successful in 4m57s
/ playwright (push) Failing after 11m30s
/ surge (push) Successful in 3m39s
Merge remote-tracking branch 'origin/main'
# Conflicts:
#	.github/workflows/playwright.yaml
#	.github/workflows/vercel.yaml
2025-04-03 00:47:24 +08:00

40 lines
1.2 KiB
YAML

defaults:
run:
shell: bash
env:
TZ: Asia/Shanghai
on:
push:
jobs:
surge:
runs-on: ubuntu-latest
outputs:
url: ${{ steps.surge_deploy.outputs.url }}
steps:
- name: ⚙️ 设置 Node 环境
uses: yanhao98/composite-actions/setup-node-environment@2d4be1a8aaded8b30f9d42cd50b2e15dc94a705c
- name: 🔨 构建项目
run: pnpm run build-only
env:
VITE_BUILD_COMMIT: ${{ github.sha }}
- name: 🚀 部署到 Surge
id: surge_deploy
if: ${{ github.actor != 'nektos/act' }} # https://nektosact.com/usage/index.html#skipping-steps
uses: yanhao98/composite-actions/deploy-dist-to-surge@2d4be1a8aaded8b30f9d42cd50b2e15dc94a705c
playwright:
needs: surge
runs-on: ubuntu-latest
container: yanhao98/runner-images:pnpm-with-playwright
steps:
- name: ⚙️ 设置 Node 环境
uses: yanhao98/composite-actions/setup-node-environment@2d4be1a8aaded8b30f9d42cd50b2e15dc94a705c
- name: 📥 安装 Playwright 浏览器
run: pnpm exec playwright install --with-deps
- name: ▶️ 运行 Playwright 测试
run: npx playwright test
env:
BASE_URL: ${{ needs.surge.outputs.url }}