ci(docker): add support for repository_dispatch event type (#8876)
This will allow to trigger workflow from Jenkins. Refs #8875
This commit is contained in:
15
.github/workflows/docker-build-push.yml
vendored
15
.github/workflows/docker-build-push.yml
vendored
@@ -13,6 +13,9 @@ on:
|
||||
type: string
|
||||
required: true
|
||||
|
||||
repository_dispatch:
|
||||
type: [docker_build_push]
|
||||
|
||||
env:
|
||||
REGISTRY_IMAGE: swaggerapi/swagger-ui
|
||||
|
||||
@@ -21,8 +24,8 @@ jobs:
|
||||
name: Normalize inputs
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
git_ref: ${{ steps.workflow_dispatch.outputs.git_ref }}
|
||||
docker_tag: ${{ steps.workflow_dispatch.outputs.git_ref }}
|
||||
git_ref: ${{ steps.workflow_dispatch.outputs.git_ref || steps.repository_dispatch.outputs.git_ref }}
|
||||
docker_tag: ${{ steps.workflow_dispatch.outputs.docker_tag || steps.repository_dispatch.outputs.docker_tag }}
|
||||
|
||||
steps:
|
||||
- name: Normalize inputs of `workflow_dispatch` event
|
||||
@@ -32,6 +35,14 @@ jobs:
|
||||
echo "git_ref=${{ inputs.git_ref }}" >> "$GITHUB_OUTPUT"
|
||||
echo "docker_tag=${{ inputs.docker_tag }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Normalize inputs of `repository_dispatch` event
|
||||
id: repository_dispatch
|
||||
if: ${{ github.event_name == 'repository_dispatch' }}
|
||||
run: |
|
||||
echo "git_ref=${{ github.event.client_payload.git_ref }}" >> "$GITHUB_OUTPUT"
|
||||
echo "docker_tag=${{ github.event.client_payload.docker_tag }}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
|
||||
|
||||
build:
|
||||
name: Build & Push SwaggerUI platform specific Docker images
|
||||
|
||||
Reference in New Issue
Block a user