-
-
Notifications
You must be signed in to change notification settings - Fork 437
42 lines (38 loc) · 1.34 KB
/
dispatch_deploy.yml
File metadata and controls
42 lines (38 loc) · 1.34 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
39
40
41
42
name: Dispatch Deploy
on:
workflow_dispatch:
inputs:
version:
description: 'Version to deploy (no leading v). Leave blank to let the downstream pick the latest release. Example: 2.94.1'
required: false
type: string
workflow_call:
inputs:
version:
description: 'Version to deploy (no leading v).'
required: true
type: string
permissions: {}
jobs:
dispatch:
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Generate GitHub App token
id: app-token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ secrets.GH_APP_MANAGER_ID }}
private-key: ${{ secrets.GH_APP_MANAGER_PRIVATE_KEY }}
owner: supabase
- name: Dispatch version update
env:
GH_TOKEN: ${{ steps.app-token.outputs.token }}
TARGET_REPO: ${{ secrets.DEPLOY_TARGET_REPO }}
VERSION: ${{ inputs.version }}
SOURCE: ${{ github.event_name == 'workflow_dispatch' && 'manual-dispatch' || 'realtime-release' }}
run: |
gh api "repos/${TARGET_REPO}/dispatches" \
--method POST \
--field event_type=realtime-release \
--field "client_payload[version]=${VERSION}" \
--field "client_payload[source]=${SOURCE}"