Skip to content

Upload Preview

Upload Preview #2331

Workflow file for this run

# 把 PR 构建的页面推送到 Netlify
# 由于涉及 secrets,所以不能直接在 build.yml 中配置
name: Upload Preview
on:
workflow_run:
workflows: ['Build', 'Storybook Build']
types:
- completed
jobs:
upload:
concurrency:
group: upload-preview-${{ github.event.workflow_run.head_repository.owner.login }}-${{ github.event.workflow_run.head_branch }}
cancel-in-progress: false
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-js-env
- run: npx tsx ./.github/scripts/upload-preview.mts
env:
workflow_name: '${{ github.event.workflow.name }}'
GH_TOKEN: ${{ github.token }}
RUN_ID: ${{ github.event.workflow_run.id }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_PREVIEW_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_PREVIEW_SITE_ID }}