Skip to content

Trigger Developer Portal Build #20

Trigger Developer Portal Build

Trigger Developer Portal Build #20

name: "Trigger Developer Portal Build"
#
# Triggers:
# - idn & nerm: gated on "Build Bundled Specifications" via workflow_run.
# That workflow runs on idn/** and nerm/** changes and commits the bundled
# idn/sailpoint-api.yaml back to main, which the portal consumes — so we
# wait for it to finish before dispatching, rather than racing it on the
# raw push. (A direct idn/** push path would dispatch too early.)
# - iiq: not part of "Build Bundled Specifications", so it needs its own
# push trigger.
on:
workflow_run:
workflows: ["Build Bundled Specifications"]
types:
- completed
branches:
- main
push:
branches:
- main
paths:
- iiq/**
workflow_dispatch:
jobs:
trigger_dev_portal_build:
name: Dispatch build to developer portal
runs-on: ubuntu-latest
# For workflow_run, only proceed on a successful upstream run.
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Dispatch build to developer.sailpoint.com
run: |
curl -sSf -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${{ secrets.DEVREL_SERVICE_TOKEN }}" \
-H "X-GitHub-Api-Version: 2022-11-28" \
https://api.github.com/repos/sailpoint-oss/developer.sailpoint.com/dispatches \
-d '{"event_type":"api-specs-updated"}'
trigger_dev_portal_build-failure:
runs-on: ubuntu-latest
if: ${{ always() && (needs.trigger_dev_portal_build.result == 'failure' || needs.trigger_dev_portal_build.result == 'timed_out') }}
needs:
- trigger_dev_portal_build
steps:
- name: Invoke GithubNotificationsFunction Lambda
run: |
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"workflowName": "${{ github.job }}",
"repositoryName": "${{ github.event.repository.name }}",
"url": "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
}' \
"${{ secrets.NOTIFICATIONS_FUNCTION_URL }}"