-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
91 lines (81 loc) · 2.54 KB
/
action.yaml
File metadata and controls
91 lines (81 loc) · 2.54 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: 'Cloud Deploy Action'
description: 'Cloud Deploy Action'
inputs:
CLIENT_ID:
description: 'StackSpot Client Id.'
required: true
CLIENT_KEY:
description: 'StackSpot Client Secret Key.'
required: true
CLIENT_REALM:
description: 'StackSpot Client Realm.'
required: true
VERBOSE:
description: 'Verbose configuration.'
required: false
APPLICATION_FILE:
description: 'Application file path to use.'
required: true
PARAMETERS:
description: 'The current parameters to replace wit values. Accepts an array.'
required: false
BACKOFF_INITIAL:
description: 'Initial wait time (in seconds) before retrying deployment status check.'
required: false
default: '5'
BACKOFF_FACTOR:
description: 'Multiplicative factor for exponential backoff.'
required: false
default: '2'
BACKOFF_MAX_RETRIES:
description: 'Maximum number of retries for deployment status check.'
required: false
default: '30'
runs:
using: "composite"
steps:
- name: Check Runner
run: echo 🤖 OS runner is $(uname)
shell: bash
- name: Setup Python
uses: actions/setup-python@v5.2.0
with:
python-version: '3.12'
- name: Install python libraries
run: pip install requests ruamel-yaml==0.18.6
shell: bash
- name: Replace multiple values in a specific file
if: ${{ inputs.PARAMETERS != '' }}
uses: GuillaumeFalourd/replace-values-action@v1.1
with:
file_path: ${{ inputs.APPLICATION_FILE }}
parameters: |
${{ inputs.PARAMETERS }}
- name: Check application file
if: ${{ inputs.VERBOSE != '' }}
run: cat ${{ inputs.APPLICATION_FILE }}
shell: bash
- name: Start StackSpot Cloud Deploy
id: deployment
env:
CLIENT_ID: ${{ inputs.CLIENT_ID }}
CLIENT_KEY: ${{ inputs.CLIENT_KEY }}
CLIENT_REALM: ${{ inputs.CLIENT_REALM }}
VERBOSE: ${{ inputs.VERBOSE }}
APPLICATION_FILE: ${{ inputs.APPLICATION_FILE }}
BACKOFF_INITIAL: ${{ inputs.BACKOFF_INITIAL }}
BACKOFF_FACTOR: ${{ inputs.BACKOFF_FACTOR }}
BACKOFF_MAX_RETRIES: ${{ inputs.BACKOFF_MAX_RETRIES }}
run: |
if [ ${{runner.os}} != 'Windows' ]; then
python3 ${{ github.action_path }}/deployment.py
elif [ ${{runner.os}} == 'Windows' ]; then
python ${{ github.action_path }}\deployment.py
else
echo "${{runner.os}} not supported"
exit 1
fi
shell: bash
branding:
icon: 'terminal'
color: 'gray-dark'