Skip to content

Commit

Permalink
[gh workflow] Added workflow_dispatch for building images
Browse files Browse the repository at this point in the history
  • Loading branch information
didierofrivia committed Mar 20, 2023
1 parent c32b935 commit 51185f9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ on:
branches: ['*']
tags: ['*']
workflow_call:
workflow_dispatch:
inputs:
authorinoOperatorBundleVersion:
description: Authorino Operator bundle version
required: true
default: latest
limitadorOperatorBundleVersion:
description: Limitador Operator bundle version
required: true
default: latest
wasmShimVersion:
description: WASM Shim version
required: true
default: latest

env:
IMG_TAGS: ${{ github.sha }}
Expand Down Expand Up @@ -104,13 +118,21 @@ jobs:
echo "AUTHORINO_OPERATOR_VERSION=${vars.AUTHORINO_OPERATOR_BUNDLE_SHA}" >> $GITHUB_ENV
echo "LIMITADOR_OPERATOR_VERSION=${vars.LIMITADOR_OPERATOR_BUNDLE_SHA} >> $GITHUB_ENV
echo "WASM_SHIM_VERSION=${vars.WASM_SHIM_SHA} >> $GITHUB_ENV
- name: Add specific tags if triggered by workflow dispatch
if: ${{ github.event_name == "workflow_dispatch" }}
id: set-dependencies-specific-tags
run: |
echo "Setting dependencies image versions from user input..."
echo "AUTHORINO_OPERATOR_VERSION=${github.event.inputs.authorinoOperatorBundleVersion}" >> $GITHUB_ENV
echo "LIMITADOR_OPERATOR_VERSION=${github.event.inputs.limitadorOperatorBundleVersion} >> $GITHUB_ENV
echo "WASM_SHIM_VERSION=${github.event.inputs.wasmShimVersion} >> $GITHUB_ENV
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Run make bundle
run: |
if [[ ${github.event_name} == "workflow_call" ]]; then
if [[ ${github.event_name} == "workflow_call" || ${github.event_name} == "workflow_dispatch" ]]; then
echo "Building bundle via workflow call"
make bundle REGISTRY=${{ env.IMG_REGISTRY_HOST }} ORG=${{ env.IMG_REGISTRY_ORG }} VERSION=${TAG_NAME/v/} AUTHORINO_OPERATOR_VERSION=${env.AUTHORINO_OPERATOR_VERSION} LIMITADOR_OPERATOR_VERSION=${env.LIMITADOR_OPERATOR_VERSION} WASM_SHIM_VERSION=${env.WASM_SHIM_VERSION}
else
Expand Down

0 comments on commit 51185f9

Please sign in to comment.