-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (31 loc) · 1 KB
/
Copy path_deploy_edge_functions.yml
File metadata and controls
38 lines (31 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: _deploy_edge_functions
on:
workflow_call:
inputs:
target:
description: "staging or prod"
required: true
type: string
permissions:
contents: read
jobs:
deploy:
name: Deploy edge functions (${{ inputs.target }})
runs-on: ubuntu-latest
timeout-minutes: 10
environment: ${{ inputs.target == 'prod' && 'production' || (inputs.target == 'staging' && 'staging' || '') }}
steps:
- name: Validate target
run: |
case "${{ inputs.target }}" in
staging|prod) ;;
*) echo "Invalid target: ${{ inputs.target }}"; exit 1 ;;
esac
- uses: actions/checkout@v5
- uses: supabase/setup-cli@v3
- name: Deploy functions
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
PROJECT_REF: ${{ inputs.target == 'prod' && vars.PROD_PROJECT_REF || vars.STAGING_PROJECT_REF }}
run: |
supabase functions deploy --use-api --project-ref "$PROJECT_REF"