-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
75 lines (74 loc) · 2.32 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
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
---
name: 'hostwithquantum/setup-runway'
description: 'Setup the runway CLI on GitHub Actions'
branding:
icon: 'zap'
color: 'yellow'
inputs:
username:
required: true
description: runway account
password:
required: true
description: runway password
public-key:
description: ssh public key location
required: true
default: "~/.ssh/id_rsa.pub"
private-key:
description: ssh private key location
required: true
default: "~/.ssh/id_rsa"
add-key:
description: if set to true, run "runway key create"
required: true
default: 'false'
setup-ssh:
description: if set to true, setup ssh to work for "runway app deploy"
default: 'false'
log-level:
description: debug, info, warn, error
default: error
required: true
version:
description: runway cli version
default: "latest"
required: true
controller-url:
description: Custom controller URL (for testing + enterprise)
required: false
runs:
using: "composite"
steps:
- name: install runway cli
run: |
curl \
-H 'Cache-Control: no-cache' \
"https://s3.storage.planetary-networks.de/download.runway.horse/runway/${{ inputs.version }}/runway_linux_amd64?nocache=$(date +%s)" \
-o ${{ github.action_path }}/runway \
&& chmod +x ${{ github.action_path }}/runway
shell: bash
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
shell: bash
- run: runway -v -q
shell: bash
- run: echo "RUNWAY_NONINTERACTIVE=true" >> $GITHUB_ENV
shell: bash
- run: runway -l ${{ inputs.log-level }} -q login -u "${{ inputs.username }}" -p "${{ inputs.password }}"
shell: bash
- run: runway -l ${{ inputs.log-level }} -q key create ${{ inputs.public-key }}
if: ${{ inputs.add-key == 'true' }}
shell: bash
- run:
echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV
if: ${{ inputs.setup-ssh == 'true' }}
shell: bash
- run: |
ssh-keyscan -p 2222 deploy.runway.horse >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add ${{ inputs.private-key }}
if: ${{ inputs.setup-ssh == 'true' }}
shell: bash
- run: echo "RUNWAY_CONTROLLER=${{ inputs.controller-url }}" >> $GITHUB_ENV
if: ${{ inputs.controller-url != '' }}
shell: bash