Skip to content

Commit fc0fa1f

Browse files
committed
Chore: optionally include ssl setup; switch to production
1 parent c38c2f3 commit fc0fa1f

File tree

2 files changed

+52
-26
lines changed

2 files changed

+52
-26
lines changed

README.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,19 @@ A GitHub action to setup the runway CLI! Questions, issues? Please use discussio
1818
1919
Currently supported options:
2020
21-
| option | default value | description |
22-
|---------------|---------------|-------------------------------------------|
23-
| username | `<none>` | username/email for runway |
24-
| password | `<none>` | password for runway |
25-
| public-key | `<none>` | use this to add a new key to your account |
26-
| download-link | ... | this is a link to our S3-storage |
27-
| log-level | `error` | debug, info, warn, error |
28-
| version | `latest` | will be added before `v1` |
29-
30-
> Since we are pre-1.0, latest is fine. We still do not want to break your workflows. But sometimes BC breaks are necessary. Because they usually involve our client and APIs, using latest helps to keep all interruptions to a minimum.
21+
| option | default value | description |
22+
|---------------|---------------------|---------------------------------------------------|
23+
| username | `<none>` | username/email for runway |
24+
| password | `<none>` | password for runway |
25+
| add-key | `false` | if set to true, add the ssh key to runway |
26+
| setup-ssh | `false` | if set to true, setup ssh for `runway app deploy` |
27+
| log-level | `error` | debug, info, warn, error |
28+
| public-key | `~/.ssh/id_rsa.pub` | ssh public key location |
29+
| public-key | `~/.ssh/id_rsa` | ssh private key location |
30+
| log-level | `error` | debug, info, warn, error |
31+
| version | `latest` | `runway` cli version |
32+
33+
> For the version, `latest` is fine. We strive to never break your workflows. But sometimes BC breaks are necessary. Because they usually involve our client and APIs, using `latest` helps to keep all interruptions to a minimum.
3134

3235
## Examples
3336

@@ -65,6 +68,7 @@ jobs:
6568
with:
6669
username: ${{ secrets.RUNWAY_USERNAME }}
6770
password: ${{ secrets.RUNWAY_PASSWORD }}
71+
setup-ssh: true
6872
- run: runway -y gitremote -a ${YOUR_APPLICATION_NAME}
6973
- run: runway -y app deploy
7074
```
@@ -85,27 +89,23 @@ jobs:
8589
deploy_app:
8690
runs-on: ubuntu-latest
8791
timeout-minutes: 15
88-
env:
89-
RUNWAY_LOGLEVEL: info
90-
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
9192
steps:
9293
- uses: actions/checkout@v3
9394
with:
94-
fetch-depth: 0
95+
fetch-depth: 0 # this is important!
9596
- name: create an ssh key just for this run
9697
run: |
9798
mkdir -p ~/.ssh/
9899
ssh-keygen -b 2048 -t rsa -f ~/.ssh/test-runner -c "test-key-${{ github.run_id }}" -q -N ""
99-
- run: |
100-
ssh-keyscan -p 2222 api-builder.staging.pqapp.dev >> ~/.ssh/known_hosts
101-
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
102-
ssh-add ~/.ssh/test-runner
103100
- name: install CLI, login and add ssh key
104101
uses: hostwithquantum/[email protected]
105102
with:
106103
username: ${{ secrets.RUNWAY_USERNAME }}
107104
password: ${{ secrets.RUNWAY_PASSWORD }}
108105
public-key: ~/.ssh/test-runner.pub
106+
private-key: ~/.ssh/test-runner
107+
add-key: true
108+
setup-ssh: true
109109
- name: create app on runway (with a **unique name**)
110110
run: runway -y app create -a my-cool-app-${{ github.run_id }}
111111
- name: deploy your app to runway

action.yml

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,32 +12,58 @@ inputs:
1212
required: true
1313
description: runway password
1414
public-key:
15-
description: ssh (public) key
16-
required: false
17-
download-link:
18-
description: 'Download link for runway CLI'
15+
description: ssh public key location
1916
required: true
20-
default: 'https://s3.storage.planetary-networks.de/download.staging.pqapp.dev/runway/latest/runway_linux_amd64'
17+
default: "~/.ssh/id_rsa.pub"
18+
private-key:
19+
description: ssh private key location
20+
required: true
21+
default: "~/.ssh/id_rsa"
22+
add-key:
23+
description: if set to true, run "runway key create"
24+
type: boolean
25+
required: true
26+
default: false
27+
setup-ssh:
28+
description: if set to true, setup ssh to work for "runway app deploy"
29+
type: boolean
30+
required: true
31+
default: false
2132
log-level:
2233
description: debug, info, warn, error
2334
default: error
2435
required: true
36+
version:
37+
description: runway cli version
38+
default: "latest"
39+
required: true
2540
runs:
2641
using: "composite"
2742
steps:
2843
- name: install runway cli
2944
run: |
3045
curl \
31-
${{ inputs.download-link }} \
46+
-H 'Cache-Control: no-cache' \
47+
"https://s3.storage.planetary-networks.de/download.runway.horse/runway/${{ inputs.version }}/runway_linux_amd64?nocache=$(date +%s)" \
3248
-o ${{ github.action_path }}/runway \
3349
&& chmod +x ${{ github.action_path }}/runway
3450
shell: bash
3551
- run: echo "${{ github.action_path }}" >> $GITHUB_PATH
3652
shell: bash
3753
- run: runway -v -q
3854
shell: bash
39-
- run: runway -l ${{ inputs.log-level }} -y -q login -u ${{ inputs.username }} -p ${{ inputs.password }}
55+
- run: runway -l ${{ inputs.log-level }} -y -q login -u "${{ inputs.username }}" -p "${{ inputs.password }}"
4056
shell: bash
4157
- run: runway -l ${{ inputs.log-level }} -q -y key create ${{ inputs.public-key }}
42-
if: "${{ inputs.public-key != '' }}"
58+
if: ${{ inputs.add-key == 'true' }}
59+
shell: bash
60+
- run:
61+
echo "SSH_AUTH_SOCK=/tmp/ssh_agent.sock" >> $GITHUB_ENV
62+
if: ${{ inputs.setup-ssh == 'true' }}
63+
shell: bash
64+
- run: |
65+
ssh-keyscan -p 2222 deploy.runway.horse >> ~/.ssh/known_hosts
66+
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
67+
ssh-add ${{ inputs.private-key }}
68+
if: ${{ inputs.setup-ssh == 'true' }}
4369
shell: bash

0 commit comments

Comments
 (0)