Changed workflow_run triggers in deployment workflows to reference the updated workflow name 'Sync to Pages and Functions' instead of the previous names. This ensures deployments are triggered correctly after the new workflow completes.
48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
name: Deploy to Vercel Functions
|
|
|
|
on:
|
|
workflow_run:
|
|
workflows: ["Sync to Pages and Functions"]
|
|
types:
|
|
- completed
|
|
branches:
|
|
- main
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: false
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
permissions:
|
|
contents: read
|
|
deployments: write
|
|
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
|
|
steps:
|
|
- name: Checkout functions branch
|
|
uses: actions/checkout@v6
|
|
with:
|
|
ref: functions
|
|
|
|
- name: Setup Node.js
|
|
uses: actions/setup-node@v6
|
|
with:
|
|
node-version: "20"
|
|
cache: "npm"
|
|
|
|
- name: Install Vercel CLI
|
|
run: npm install --global vercel@latest
|
|
|
|
- name: Pull Vercel Environment Information
|
|
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
|
|
|
- name: Build Project Artifacts
|
|
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
|
|
- name: Deploy Project Artifacts to Vercel
|
|
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|