-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
49 lines (46 loc) · 1.5 KB
/
action.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
# Copyright (c) 2022 OpenFaaS Ltd
name: 'Setup the actuated-ssh-gateway'
description: 'Setup the actuated-ssh-gateway'
branding:
icon: 'arrow-right-circle'
color: 'gray-dark'
inputs:
gateway:
description: 'The gateway hostname address or IP address.'
required: false
default: ""
runs:
using: 'composite'
steps:
- name: Download the ssh-gateway client
shell: bash
id: download
run: |
if [ "$(uname -m)" = "aarch64" ]
then
curl -s -S -L https://github.com/alexellis/gha-connect-client/releases/download/v0.0.5/gha-connect-arm64 -o /tmp/gha-connect
else
curl -s -S -L https://github.com/alexellis/gha-connect-client/releases/download/v0.0.5/gha-connect -o /tmp/gha-connect
fi
chmod +x /tmp/gha-connect
sudo mv /tmp/gha-connect /usr/local/bin/
- name: Where am i?
shell: bash
id: add_geolocation_script
run: |
echo "#!/bin/bash" | sudo tee -a /usr/local/bin/whereami
echo "curl -s http://ip-api.com/json|jq" | sudo tee -a /usr/local/bin/whereami
sudo chmod +x /usr/local/bin/whereami
- name: Run the client in the background
shell: bash
id: connectbg
env:
GATEWAY: ${{ inputs.gateway }}
run: |
gha-connect -url ${GATEWAY:-""} &
gha-connect -confirm
EXIT_CODE=$?
if [ "$EXIT_CODE" = "1" ]
then
exit 1
fi