-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (51 loc) · 1.77 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
52
53
54
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: "Document tag to deploy, e.g v1.76.1"
required: true
env:
description: "Target environment: staging or production"
required: false
default: "staging"
push:
tags:
- "v*"
permissions:
contents: write
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@v3
with:
token: ${{ secrets.ATALA_GITHUB_TOKEN }} # Personal access token that triggers the deployment (Hyperledger => IOG)
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 }}"}'