Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/actions/repository-dispatch/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'Internal Repository Dispatch'
description: 'Trigger repository dispatch events'
inputs:
token:
description: 'GitHub token'
required: true
repository:
description: 'Repository in format owner/repo'
required: true
event-type:
description: 'Event type to trigger'
required: true
client-payload:
description: 'JSON payload'
required: false
default: '{}'

runs:
using: 'composite'
steps:
- name: Trigger repository dispatch
shell: bash
run: |
curl -L \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ inputs.token }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/${{ inputs.repository }}/dispatches \
-d '{
"event_type": "${{ inputs.event-type }}",
"client_payload": ${{ inputs.client-payload }}
}'
26 changes: 26 additions & 0 deletions .github/workflows/deploy-testnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy to Testnet

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types: [ closed ]

jobs:
trigger-deploy:
if: github.event_name == 'push' || (github.event.pull_request.merged == true)
runs-on: ubuntu-latest
steps:
- name: Checkout this magicblock-validator
uses: actions/checkout@v2
with:
path: magicblock-validator

- name: Trigger deploy workflow
uses: ./magicblock-validator/.github/actions/repository-dispatch
with:
token: ${{ secrets.DEPLOY_TRIGGER_TOKEN }}
repository: magicblock-labs/validator-deployment
event-type: auto-deploy
client-payload: '{"project": "magicblock-validator", "deploy_target": "testnet", "branch": "master", "triggered_by": "${{ github.actor }}", "source_repo": "${{ github.repository }}", "source_sha": "${{ github.sha }}"}'
Loading