Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add workflow to trigger auto-deployment (#111)
* ci: add workflow to trigger auto-deployment * ci: add deployment inputs capabilities
- Loading branch information
abalias
committed
Nov 11, 2022
1 parent
859fac5
commit 5a0b4f4
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Deployment | ||
|
||
# Trigger deployment when a new tag is pushed | ||
# to a service component | ||
on: | ||
push: | ||
tags: | ||
- prism-agent-* | ||
- iris-service-* | ||
- mercury-mediator-* | ||
workflow_dispatch: | ||
inputs: | ||
component-tag: | ||
description: "Tag of a component to trigger the update, e.g. iris-service-v0.5.0" | ||
required: true | ||
env: | ||
description: "Environment to trigger update on" | ||
required: false | ||
default: "dev" | ||
|
||
jobs: | ||
trigger-deployment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Parse input parameters | ||
id: parse-params | ||
run: | | ||
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then | ||
echo "COMPONENT_TAG=${{ github.event.inputs.component-tag }}" >> $GITHUB_OUTPUT | ||
echo "ENV=${{ github.event.inputs.env }}" >> $GITHUB_OUTPUT | ||
else | ||
echo "COMPONENT_TAG=${{ github.ref_name}}" >> $GITHUB_OUTPUT | ||
echo "ENV=dev" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Trigger deployment | ||
uses: peter-evans/repository-dispatch@v2 | ||
with: | ||
token: ${{ secrets.ATALA_GITHUB_TOKEN }} | ||
repository: input-output-hk/atala-prism-dev-deployments | ||
event-type: trigger-deployment | ||
client-payload: '{"component-tag": "${{ steps.parse-params.outputs.COMPONENT_TAG }}", "env": "${{ steps.parse-params.outputs.ENV }}"}' |