-
Notifications
You must be signed in to change notification settings - Fork 212
Expand file tree
/
Copy pathaction.yml
More file actions
63 lines (57 loc) · 2.35 KB
/
action.yml
File metadata and controls
63 lines (57 loc) · 2.35 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
name: update_mrt_target
description: Update a MRT target environment. This endpoint automatically re-deploys the current bundle if any of the SSR-related properties are changed.
inputs:
PROJECT_SLUG:
description: 'MRT Project slug'
required: true
TARGET_SLUG:
description: 'MRT Target slug'
required: true
MOBIFY_API_KEY:
description: 'Mobify API key'
required: true
CLOUD_ORIGIN:
description: 'MRT Cloud origin'
required: false
default: 'https://cloud.mobify.com'
MRT_TARGET_SETTINGS_FILE_PATH:
description: 'Path to .env file containing MRT target environment settings'
required: false
MRT_TARGET_VARS_FILE_PATH:
description: 'Path to .env file containing environment variables to be set on the MRT target environment'
required: false
runs:
using: composite
steps:
- name: Update MRT Target Settings
id: update_mrt_target_settings
if: ${{ inputs.MRT_TARGET_SETTINGS_FILE_PATH != '' }}
shell: bash
run: |-
set -e
# Build arguments for the Node.js script
ARGS=(
"--project-slug" "${{ inputs.PROJECT_SLUG }}"
"--target-slug" "${{ inputs.TARGET_SLUG }}"
"--mobify-api-key" "${{ inputs.MOBIFY_API_KEY }}"
"--cloud-origin" "${{ inputs.CLOUD_ORIGIN }}"
"--env-file" "${{ inputs.MRT_TARGET_SETTINGS_FILE_PATH }}"
)
# Run the Node.js script
node e2e/scripts/update-mrt-target.js target "${ARGS[@]}"
- name: Update MRT Target Environment Variables
id: update_mrt_target_env_vars
if: ${{ inputs.MRT_TARGET_VARS_FILE_PATH != '' }}
shell: bash
run: |-
set -e
# Build arguments for the Node.js script
ARGS=(
"--project-slug" "${{ inputs.PROJECT_SLUG }}"
"--target-slug" "${{ inputs.TARGET_SLUG }}"
"--mobify-api-key" "${{ inputs.MOBIFY_API_KEY }}"
"--env-file" "${{ inputs.MRT_TARGET_VARS_FILE_PATH }}"
"--cloud-origin" "${{ inputs.CLOUD_ORIGIN }}"
)
# Run the Node.js script
node e2e/scripts/update-mrt-target.js env-var "${ARGS[@]}"