Skip to content

Commit 2d17854

Browse files
committed
Update(action): setup public/private ssh key
1 parent f181458 commit 2d17854

File tree

1 file changed

+53
-42
lines changed

1 file changed

+53
-42
lines changed

README.md

Lines changed: 53 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22

33
![hostwithquantum/setup-runway](setup-runway-banner.jpeg)
44

5-
A GitHub action to setup the runway CLI! Questions, issues? Please use discussions or the issue tracker on the repository. If you like what you see here, **we appreciate a** :star: and if you'd subscribe to [(our monthly) mailing list](https://outreach.planetary-quantum.com/) and [check out the website to stay](https://www.runway.horse/) in the loop!
5+
A GitHub action to setup the Runway CLI! Questions, issues? Please use discussions or the issue tracker on the repository. If you like what you see here, **we appreciate a** :star: and if you'd subscribe to [(our monthly) mailing list](https://outreach.planetary-quantum.com/) and [check out the website to stay](https://www.runway.horse/) in the loop!
6+
7+
---
8+
9+
This action supports amd64 and arm64 Linux runners.
610

711
## Quick Start
812

@@ -12,39 +16,46 @@ steps:
1216
- uses: actions/checkout@v4
1317
with:
1418
fetch-depth: 0
15-
- uses: hostwithquantum/setup-runway@v0.4.0
19+
- uses: hostwithquantum/setup-runway@v0.5.0
1620
with:
1721
username: ${{ secrets.RUNWAY_USERNAME }}
1822
password: ${{ secrets.RUNWAY_PASSWORD }}
1923
- run: runway whoami
2024
```
2125
22-
## Options
26+
## Action Inputs
2327
24-
Currently supported options:
28+
The currently supported inputs:
2529
26-
| option | default value | description |
27-
|---------------|---------------------|---------------------------------------------------|
28-
| username | `<none>` | username/email for runway |
29-
| password | `<none>` | password for runway |
30-
| add-key | `false` | if set to true, add the ssh key to runway |
31-
| setup-ssh | `false` | if set to true, setup ssh for `runway app deploy` |
32-
| log-level | `error` | debug, info, warn, error |
33-
| public-key-location | `~/.ssh/id_rsa.pub` | ssh public key location |
34-
| public-key-location | `~/.ssh/id_rsa` | ssh private key location |
35-
| log-level | `error` | debug, info, warn, error |
36-
| version | `latest` | `runway` cli version |
37-
| controller | `` | controller URL for Enterprise installations |
30+
| option | default value | description |
31+
|---------------------|---------------------|---------------------------------------------------|
32+
| username | _empty_ | username/email for Runway |
33+
| password | _empty_ | password for Runway |
34+
| add-key | `false` | if set to true, add the ssh key to Runway |
35+
| setup-ssh | `false` | if set to true, setup ssh for `runway app deploy` |
36+
| log-level | `error` | debug, info, warn, error |
37+
| public-key | _empty_ | a public ssh key (from a secret) |
38+
| private-key | _empty_ | a public ssh key (from a secret) |
39+
| public-key-location | `~/.ssh/id_rsa.pub` | ssh public key location |
40+
| public-key-location | `~/.ssh/id_rsa` | ssh private key location |
41+
| version | `latest` | `runway` cli version |
42+
| controller | _empty_ | controller URL for Enterprise installations |
3843

39-
> 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.
44+
> [!TIP]
45+
> For the Runway CLI 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.
46+
47+
> [!IMPORTANT]
48+
> There's a BC break in this action in `v0.5.0`, previously the `public-key` and `private-key` inputs contained paths. They have been renamed to `public-key-location` and `private-key-location` to make their purpose known. The _new_ `public-key` and `private-key` inputs are optional and contain your (SSH) public and private key if used.
4049

4150
## Examples
4251

43-
### Setup the runway CLI to deploy
52+
The following examples show how this action and the Runway CLI can be used in workflows.
53+
54+
### Deployments
4455

45-
This is an example workflow which shows runway CLI setup and then how to use the CLI to deploy your app `cool-app`.
56+
This is an example workflow which shows Runway CLI setup and then how to use the CLI to deploy your application `cool-app`.
4657

47-
Once the client is setup, you can run all commands and play around with output and so on. To keep it simple, we're only deploying the code. :) Since the app exists already on runway we use the `runway gitremote` command to initialize the setup.
58+
Once the CLI is setup, you can run all commands and play around with output and so on. To keep it simple, we're only deploying the code. :) Since the application exists already on Runway we use the `runway gitremote` command to initialize the setup.
4859

4960
```yaml
5061
# .github/workflows/release.yml
@@ -63,29 +74,25 @@ jobs:
6374
steps:
6475
- uses: actions/checkout@v4
6576
with:
66-
fetch-depth: 0
67-
- name: create public/private key on GHA
68-
run: |
69-
mkdir -p ~/.ssh/
70-
echo "${{ secrets.PRIVATE_KEY }}" > ~/.ssh/id_rsa
71-
echo "${{ secrets.PUBLIC_KEY }}" > ~/.ssh/id_rsa.pub
72-
chmod 0600 ~/.ssh/id_rsa*
73-
- uses: hostwithquantum/setup-runway@v0.4.0
77+
fetch-depth: 0 # this is important
78+
- uses: hostwithquantum/setup-runway@v0.5.0
7479
with:
7580
username: ${{ secrets.RUNWAY_USERNAME }}
7681
password: ${{ secrets.RUNWAY_PASSWORD }}
77-
setup-ssh: true
82+
private-key: ${{ secrets.PRIVATE_KEY }}
83+
public-key: ${{ secrets.PUBLIC_KEY }}
7884
- run: runway gitremote -a ${YOUR_APPLICATION_NAME}
7985
- run: runway app deploy
86+
- run: runway logout
8087
```
8188

8289
### Running e2e tests
8390

84-
GitHub Actions provides a robust and comprehensive environment to run e2e tests and here's how runway can help:
91+
GitHub Actions provides a robust and comprehensive environment to run e2e tests and here's how Runway can help:
8592

86-
The following workflow leverages some of the context in form of `${{ github.run_id }}`. We'll use this _identifier_ to deploy an app with a unique name. Another viable option is to use the pull-requests's number: `${{ github.event.number }}`.
93+
The following workflow leverages some of the context in form of `${{ github.run_id }}`. We'll use this _identifier_ to deploy an application with a unique name. Another viable option is to use the pull-requests's number: `${{ github.event.number }}`.
8794

88-
Once deployed, you can run end-to-end tests against it and in the end, shut it down by deleting the app (and key). :) If you decide to keep the application to have a preview available, you may also do that.
95+
Once deployed, you can run end-to-end tests against it and in the end, shut it down by deleting the application (and key). :) If you decide to keep the application to have a preview available, you may also do that.
8996

9097
```yaml
9198
# .github/workflows/e2e.yml
@@ -109,36 +116,39 @@ jobs:
109116
run: |
110117
mkdir -p ~/.ssh/
111118
ssh-keygen -b 2048 -t rsa -f ~/.ssh/test-runner -c "test-key-${{ github.run_id }}" -q -N ""
112-
- name: install CLI, login and add ssh key
113-
uses: hostwithquantum/setup-runway@v0.4.0
119+
- name: install Runway CLI, login and add ssh key
120+
uses: hostwithquantum/setup-runway@v0.5.0
114121
with:
115122
username: ${{ secrets.RUNWAY_USERNAME }}
116123
password: ${{ secrets.RUNWAY_PASSWORD }}
117-
public-key: ~/.ssh/test-runner.pub
118-
private-key: ~/.ssh/test-runner
124+
public-key-location: ~/.ssh/test-runner.pub
125+
private-key-location: ~/.ssh/test-runner
119126
add-key: true
120127
setup-ssh: true
121-
- name: create app on runway
128+
- name: create application on Runway
122129
run: runway app create -a $APP_NAME || runway gitremote -a $APP_NAME
123-
- name: deploy your app to runway
130+
- name: deploy your application to Runway
124131
run: runway app deploy
125132
# this is where your tests run!
126133
- name: run your e2e tests here
127134
run: curl https://$APP_NAME.pqapp.dev/
128135
# then hopefully you are done :)
129-
- name: cleanup app
136+
- name: cleanup application
130137
if: always()
131138
run : runway app rm -a $APP_NAME || true
132139
- name: cleanup key - this is brute force
133140
if: always()
134141
run: runway key rm "test-key-${{ github.run_id }}" || true
142+
- name: logout
143+
if: always()
144+
run: runway logout
135145
```
136146

137147
### Preview apps
138148

139-
In the previous example, we mentioned that keeping an app for people (humans!) to look at it, may be beneficial.
149+
In the previous example, we mentioned that keeping an application for people (humans!) to look at it, may be beneficial.
140150

141-
The following workflow expands on those concepts and deletes an application from runway when a pull-request is closed (merged or closed without merge). This example _assumes_ that you constructed the application name like, `my-app-${{ github.event.number }}` (instead of `github.run_id`).
151+
The following workflow expands on those concepts and deletes an application from Runway when a pull-request is closed (merged or closed without merge). This example _assumes_ that you constructed the application name like, `my-app-${{ github.event.number }}` (instead of `github.run_id`).
142152

143153
```yaml
144154
name: delete app
@@ -152,9 +162,10 @@ jobs:
152162
delete:
153163
runs-on: ubuntu-latest
154164
steps:
155-
- uses: hostwithquantum/setup-runway@v0.4.0
165+
- uses: hostwithquantum/setup-runway@v0.5.0
156166
with:
157167
username: ${{ secrets.QUANTUM_RUNWAY_USERNAME }}
158168
password: ${{ secrets.QUANTUM_RUNWAY_PASSWORD }}
159169
- run: runway app delete my-app-${{ github.event.number }} || true
170+
- run: runway logout
160171
```

0 commit comments

Comments
 (0)