更新 CI 工作流,使用复合动作部署到 Surge,移除旧的 Surge 预览步骤
This commit is contained in:
40
.github/workflows/ci.yaml
vendored
40
.github/workflows/ci.yaml
vendored
@ -38,19 +38,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
VITE_BUILD_COMMIT: ${{ github.sha }}
|
VITE_BUILD_COMMIT: ${{ github.sha }}
|
||||||
- name: 部署到 Surge
|
- name: 部署到 Surge
|
||||||
if: ${{ !github.event.act }} # https://nektosact.com/usage/index.html#skipping-steps
|
|
||||||
id: surge_deploy
|
id: surge_deploy
|
||||||
# pnpm exec surge token / pnpx surge token
|
if: ${{ !github.event.act }} # https://nektosact.com/usage/index.html#skipping-steps
|
||||||
# https://github.com/Tencent/tdesign-vue-next/pull/1604#issuecomment-1236244550
|
uses: yanhao98/composite-actions/deploy-dist-to-surge@c1cee30ad33e363e4a7f6a5e15b03a9d2034b922
|
||||||
# https://github.com/Tencent/tdesign-vue-next/blob/03036a19adccf4657d7792e3a61a6c6a7d902e3e/.github/workflows/preview-publish.yml
|
|
||||||
# https://github.com/Tencent/tdesign/blob/0c0c9b63897c05d10c58e1a1e36feda2cb99eca7/.github/workflows/preview.yml#L40
|
|
||||||
run: |
|
|
||||||
export DEPLOY_DOMAIN=https://${{ github.sha }}.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
|
|
||||||
|
|
||||||
echo "url=$DEPLOY_DOMAIN" >> $GITHUB_OUTPUT
|
|
||||||
- name: Install Playwright Browsers
|
- name: Install Playwright Browsers
|
||||||
run: pnpm exec playwright install --with-deps
|
run: pnpm exec playwright install --with-deps
|
||||||
- name: Run Playwright tests
|
- name: Run Playwright tests
|
||||||
@ -66,16 +56,16 @@ jobs:
|
|||||||
- run: npx depcheck || true
|
- run: npx depcheck || true
|
||||||
- run: node .depcheck.js
|
- run: node .depcheck.js
|
||||||
|
|
||||||
surge-preview:
|
# surge-preview:
|
||||||
runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
permissions:
|
# permissions:
|
||||||
pull-requests: write # allow surge-preview to create/update PR comments
|
# pull-requests: write # allow surge-preview to create/update PR comments
|
||||||
steps:
|
# steps:
|
||||||
- uses: yanhao98/composite-actions/setup-node-environment@main
|
# - uses: yanhao98/composite-actions/setup-node-environment@main
|
||||||
- uses: afc163/surge-preview@v1
|
# - uses: afc163/surge-preview@v1
|
||||||
id: surge_preview_step
|
# id: surge_preview_step
|
||||||
with:
|
# with:
|
||||||
dist: dist
|
# dist: dist
|
||||||
build: pnpm run build-only
|
# build: pnpm run build-only
|
||||||
- name: Get the preview_url
|
# - name: Get the preview_url
|
||||||
run: echo "url => ${{ steps.surge_preview_step.outputs.preview_url }}"
|
# run: echo "url => ${{ steps.surge_preview_step.outputs.preview_url }}"
|
||||||
|
Reference in New Issue
Block a user