ci: initiate enterprise build (#3424)

For each incoming PR, build the enterprise container too.
This commit is contained in:
Ankur Srivastava
2024-05-08 08:39:25 +02:00
committed by GitHub
parent dcf8eebecc
commit 5cf8a0c201
@@ -0,0 +1,32 @@
name: initiate_enterprise_build
on:
pull_request:
branches:
- "*"
jobs:
initiate_enterprise_build:
if: ${{ github.event.pull_request.head.repo.fork == false }} # Only run for PRs which are not from forks
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Generate token
id: generate_token
uses: actions/create-github-app-token@v1
with:
private-key: ${{ secrets.PRIVATE_KEY }}
app-id: ${{ secrets.APP_ID }}
# Set the owner, so the token can be used in all repositories
owner: ${{ github.repository_owner }}
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@v3
env:
TOKEN: ${{ steps.generate_token.outputs.token }}
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
with:
token: ${{ env.TOKEN }} # GitHub App installation access token
repository: openobserve/o2-enterprise
event-type: initiate-enterprise-build
client-payload: '{"o2_enterprise_repo": "main", "o2_opensource_repo": "${{ env.BRANCH_NAME }}"}'