forked from lagonapp/github-action
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
61 lines (58 loc) · 1.73 KB
/
action.yml
File metadata and controls
61 lines (58 loc) · 1.73 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
name: "Lagoss CLI"
description: "Easily integrate Lagoss CLI operations into your Github workflow"
branding:
icon: code
color: blue
inputs:
token:
description: "Your Lagoss API token"
required: true
app_id_or_name:
description: "The name or id of your application"
required: false
default: ""
prod:
description: "Publish to production"
required: false
default: false
console_url:
description: "Specify custom url for self-hosted Lagoss instances"
required: false
default: "https://console.lagoss.com"
command:
description: 'The Lagoss CLI command to run. For example: "deploy --prod --app-id-or-name <my-app>" - will publish your application'
required: false
default: ""
outputs:
cli_stdout:
description: "The raw stdout from the CLI command executed"
value: ${{ steps.cli.outputs.cli_stdout }}
runs:
using: "composite"
steps:
- name: "Install Node.js"
uses: actions/setup-node@v3
with:
node-version: 24
- name: "Install CLI"
shell: bash
run: |
npm install --global @lagoss/cli esbuild
- name: "Execute CLI"
id: cli
env:
LAGOSS_TOKEN: ${{ inputs.token }}
LAGOSS_CONSOLE_URL: ${{ inputs.console_url }}
LAGOSS_COMMAND: ${{ inputs.command || format('deploy --app-id-or-name {0} {1}', inputs.app_id_or_name, inputs.prod == 'true' && '--prod' || '') }}
shell: bash
run: |
echo "Configuring lagoss CLI..."
if [[ -z "${LAGOSS_TOKEN}" ]]; then
echo "LAGOSS_TOKEN input is not set"
exit 1
fi
# Run CLI
echo "Executing CLI ..."
eval "lagoss $LAGOSS_COMMAND" | tee lagoss.output
# Action is done!
exit $?