Skip to content

Add doc for "actions/ssh-runner" action #50

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"github-actions-integration/migrate-to-arm-runners",
"github-actions-integration/use-gpu-runners",
"github-actions-integration/ubicloud-cache",
"github-actions-integration/debug-workflow-with-ssh",
"github-actions-integration/price-performance"
]
},
Expand Down Expand Up @@ -180,4 +181,4 @@
"destination": "/docs/security/overview"
}
]
}
}
62 changes: 62 additions & 0 deletions github-actions-integration/debug-workflow-with-ssh.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
---
title: 'Debug Workflow with SSH'
---

Debugging GitHub Actions workflows can be a frustrating experience. We've all been there - you push a change to fix your workflow, wait for minutes, only to see it fail again, with limited logs that don't fully explain the issue. This trial-and-error approach is not only time consuming but also inefficient. But what if there was a better way to debug your workflows in real-time?

Ubicloud introduces a game-changing solution: the ability to SSH into managed ephemeral Ubicloud runners during workflow execution. With the [ubicloud/ssh-runner](https://github.com/ubicloud/ssh-runner) action, you can set up SSH access and connect to the runner while your workflow is executing. No more guesswork or endless commit cycles. Simply attach, debug issues in real-time, and move on—all within the same workflow run.

## Usage

To use this feature, add the following step to your workflow as the first step:

```yaml
- name: Setup SSH access
uses: ubicloud/ssh-runner@v1
with:
public-ssh-key: ${{ secrets.SSH_PUBLIC_KEY }}
wait-minutes: 30 # Optional, default is 10 minutes
```

That's it! This action will enable SSH access using the provided public key.

When you run this workflow, you'll see the following output in the logs:

```
Waiting for 30 minutes to allow SSH access...

SSH Connection Information:
User: runner
IPv4: 188.40.199.63
Command:
ssh [email protected]
```

Simply copy the SSH command from the logs, open your favorite terminal, and connect. You’ll be in the same environment as your CI job, letting you inspect files, run commands, and debug issues in real time.

Remember that each Ubicloud runner is ephemeral. Once the `wait-minutes` duration is reached after the job is completed, the VM is destroyed, along with its disk data.

<Note>
The [ubicloud/ssh-runner](https://github.com/ubicloud/ssh-runner) action is open source. Feel free to review, contribute, or open issues if you run into any snags.
</Note>

You can also set up SSH access only for failed jobs:

```yaml
- name: Setup SSH access
if: ${{ failure() }}
uses: ubicloud/ssh-runner@v1
with:
public-ssh-key: ${{ secrets.SSH_PUBLIC_KEY }}
wait-minutes: 30
```

<Warning>
Store your private SSH key securely. A short debugging session can save massive time, but best practices and security guidelines always apply.
</Warning>

## Conclusion

By allowing SSH access to your Ubicloud runners, you can debug your GitHub Actions workflows in real-time. This not only saves time but also provides a more comprehensive understanding of the issues at hand. Say goodbye to the days of blind debugging and repeated pushes. Embrace the future of efficient workflow debugging with Ubicloud.

For more information, visit the [ubicloud/ssh-runner](https://github.com/ubicloud/ssh-runner) repository.