Skip to content

Commit

Permalink
Chore: optionally include ssl setup; switch to production
Browse files Browse the repository at this point in the history
  • Loading branch information
rwos committed Nov 21, 2023
1 parent c38c2f3 commit fc0fa1f
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 26 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ A GitHub action to setup the runway CLI! Questions, issues? Please use discussio
Currently supported options:
| option | default value | description |
|---------------|---------------|-------------------------------------------|
| username | `<none>` | username/email for runway |
| password | `<none>` | password for runway |
| public-key | `<none>` | use this to add a new key to your account |
| download-link | ... | this is a link to our S3-storage |
| log-level | `error` | debug, info, warn, error |
| version | `latest` | will be added before `v1` |

> 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.
| option | default value | description |
|---------------|---------------------|---------------------------------------------------|
| username | `<none>` | username/email for runway |
| password | `<none>` | password for runway |
| add-key | `false` | if set to true, add the ssh key to runway |
| setup-ssh | `false` | if set to true, setup ssh for `runway app deploy` |
| log-level | `error` | debug, info, warn, error |
| public-key | `~/.ssh/id_rsa.pub` | ssh public key location |
| public-key | `~/.ssh/id_rsa` | ssh private key location |
| log-level | `error` | debug, info, warn, error |
| version | `latest` | `runway` cli version |

> 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.

## Examples

Expand Down Expand Up @@ -65,6 +68,7 @@ jobs:
with:
username: ${{ secrets.RUNWAY_USERNAME }}
password: ${{ secrets.RUNWAY_PASSWORD }}
setup-ssh: true
- run: runway -y gitremote -a ${YOUR_APPLICATION_NAME}
- run: runway -y app deploy
```
Expand All @@ -85,27 +89,23 @@ jobs:
deploy_app:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
RUNWAY_LOGLEVEL: info
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
fetch-depth: 0 # this is important!
- name: create an ssh key just for this run
run: |
mkdir -p ~/.ssh/
ssh-keygen -b 2048 -t rsa -f ~/.ssh/test-runner -c "test-key-${{ github.run_id }}" -q -N ""
- run: |
ssh-keyscan -p 2222 api-builder.staging.pqapp.dev >> ~/.ssh/known_hosts
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add ~/.ssh/test-runner
- name: install CLI, login and add ssh key
uses: hostwithquantum/[email protected]
with:
username: ${{ secrets.RUNWAY_USERNAME }}
password: ${{ secrets.RUNWAY_PASSWORD }}
public-key: ~/.ssh/test-runner.pub
private-key: ~/.ssh/test-runner
add-key: true
setup-ssh: true
- name: create app on runway (with a **unique name**)
run: runway -y app create -a my-cool-app-${{ github.run_id }}
- name: deploy your app to runway
Expand Down
42 changes: 34 additions & 8 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,32 +12,58 @@ inputs:
required: true
description: runway password
public-key:
description: ssh (public) key
required: false
download-link:
description: 'Download link for runway CLI'
description: ssh public key location
required: true
default: 'https://s3.storage.planetary-networks.de/download.staging.pqapp.dev/runway/latest/runway_linux_amd64'
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"
type: boolean
required: true
default: false
setup-ssh:
description: if set to true, setup ssh to work for "runway app deploy"
type: boolean
required: true
default: false
log-level:
description: debug, info, warn, error
default: error
required: true
version:
description: runway cli version
default: "latest"
required: true
runs:
using: "composite"
steps:
- name: install runway cli
run: |
curl \
${{ inputs.download-link }} \
-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: runway -l ${{ inputs.log-level }} -y -q login -u ${{ inputs.username }} -p ${{ inputs.password }}
- run: runway -l ${{ inputs.log-level }} -y -q login -u "${{ inputs.username }}" -p "${{ inputs.password }}"
shell: bash
- run: runway -l ${{ inputs.log-level }} -q -y key create ${{ inputs.public-key }}
if: "${{ 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

0 comments on commit fc0fa1f

Please sign in to comment.