Files
xget/.github/workflows/functions-ntl.yml
T
xixu-me 0e7aad4755 Add Netlify deploy workflow and unify edge handler
Introduces a new GitHub Actions workflow for deploying to Netlify, updates the Vercel workflow name, and refactors the edge function handler to support both Netlify and Vercel platforms with runtime detection. Adds Netlify-specific configuration and redirect files to enable shared handler logic, reducing code duplication and simplifying multi-platform deployments.
2025-11-25 17:55:32 +08:00

42 lines
956 B
YAML

name: Deploy to Netlify
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 Netlify CLI
run: npm install --global netlify-cli@latest
- name: Deploy to Netlify
run: netlify deploy --prod --dir=. --auth=${{ secrets.NETLIFY_AUTH_TOKEN }} --site=${{ secrets.NETLIFY_SITE_ID }}