-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (49 loc) · 1.65 KB
/
deployment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Deployment
# Trigger deployment when a new tag is pushed
# to a service component
on:
workflow_call:
inputs:
version:
required: true
type: string
env:
required: false
type: string
default: "staging"
workflow_dispatch:
inputs:
version:
description: "Version to deploy, e.g. v1.0.0"
required: true
env:
description: "Environment to trigger update on"
required: false
default: "staging"
push:
tags:
- "v*"
jobs:
trigger-deployment:
runs-on: ubuntu-latest
steps:
- name: Parse input parameters
id: parse-params
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
echo "VERSION=${{ github.event.inputs.version }}" >> "${GITHUB_OUTPUT}"
echo "ENV=${{ github.event.inputs.env }}" >> "${GITHUB_OUTPUT}"
elif [[ "${{ github.event_name }}" == "workflow_call" ]]; then
echo "VERSION=${{ inputs.version }}" >> "${GITHUB_OUTPUT}"
echo "ENV=${{ inputs.env }}" >> "${GITHUB_OUTPUT}"
else
echo "VERSION=${GITHUB_REF#refs/tags/}" >> "${GITHUB_OUTPUT}"
echo "ENV=staging" >> "${GITHUB_OUTPUT}"
fi
- name: Trigger deployment
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.ATALA_GITHUB_TOKEN }}
repository: input-output-hk/atala-prism-non-prod-argocd-state
event-type: trigger-prism-documentation-deployment
client-payload: '{"version": "${{ steps.parse-params.outputs.VERSION }}", "env": "${{ steps.parse-params.outputs.ENV }}"}'