mirror of
https://github.com/vercel/chat.git
synced 2026-09-14 18:32:29 +08:00
54 lines
1.2 KiB
YAML
54 lines
1.2 KiB
YAML
name: Release
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["CI"]
|
|
types:
|
|
- completed
|
|
branches:
|
|
- main
|
|
|
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
permissions:
|
|
contents: write
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
release:
|
|
name: Release
|
|
runs-on: ubuntu-latest
|
|
# Only run if CI workflow succeeded
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: pnpm/action-setup@v4
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 20
|
|
cache: "pnpm"
|
|
|
|
- run: pnpm install --frozen-lockfile
|
|
|
|
- run: pnpm build
|
|
env:
|
|
REDIS_URL: "redis://placeholder"
|
|
|
|
- name: Create Release Pull Request or Publish
|
|
id: changesets
|
|
uses: changesets/action@v1
|
|
with:
|
|
publish: pnpm changeset publish
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
- name: Deploy to Vercel
|
|
if: steps.changesets.outputs.published == 'true'
|
|
run: npx vercel --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
env:
|
|
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|