50 lines
1.0 KiB
YAML
50 lines
1.0 KiB
YAML
# 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
|
|
|
|
- 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 | slice(0, 7) }}
|
|
|
|
# https://github.com/Tencent/tdesign-vue-next/pull/1604#issuecomment-1236244550
|
|
- name: Surge
|
|
# pnpx surge token
|
|
run: |
|
|
pnpx surge dist https://vue-ts-example.surge.sh --token ${{ secrets.SURGE_TOKEN }}
|