Skip to content

Commit

Permalink
ci(docker): add support for repository_dispatch event type (#8876)
Browse files Browse the repository at this point in the history
This will allow to trigger workflow from Jenkins.

Refs #8875
  • Loading branch information
char0n committed Jun 2, 2023
1 parent 49da686 commit 75c78b0
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/docker-build-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
type: string
required: true

repository_dispatch:
type: [docker_build_push]

env:
REGISTRY_IMAGE: swaggerapi/swagger-ui

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 75c78b0

Please sign in to comment.