Skip to content

Commit 22c4cd8

Browse files
committed
Add doc for "actions/ssh-runner" action
1 parent c8da302 commit 22c4cd8

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-1
lines changed

docs.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"github-actions-integration/migrate-to-arm-runners",
7474
"github-actions-integration/use-gpu-runners",
7575
"github-actions-integration/ubicloud-cache",
76+
"github-actions-integration/debug-workflow-with-ssh",
7677
"github-actions-integration/price-performance"
7778
]
7879
},
@@ -180,4 +181,4 @@
180181
"destination": "/docs/security/overview"
181182
}
182183
]
183-
}
184+
}
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: 'Debug Workflow with SSH'
3+
---
4+
5+
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?
6+
7+
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.
8+
9+
## Usage
10+
11+
To use this feature, add the following step to your workflow as the first step:
12+
13+
```yaml
14+
- name: Setup SSH access
15+
uses: ubicloud/ssh-runner@v1
16+
with:
17+
public-ssh-key: ${{ secrets.SSH_PUBLIC_KEY }}
18+
wait-minutes: 30 # Optional, default is 10 minutes
19+
```
20+
21+
That's it! This action will enable SSH access using the provided public key.
22+
23+
When you run this workflow, you'll see the following output in the logs:
24+
25+
```
26+
Waiting for 30 minutes to allow SSH access...
27+
28+
SSH Connection Information:
29+
User: runner
30+
IPv4: 188.40.199.63
31+
Command:
32+
33+
```
34+
35+
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.
36+
37+
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.
38+
39+
<Note>
40+
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.
41+
</Note>
42+
43+
You can also set up SSH access only for failed jobs:
44+
45+
```yaml
46+
- name: Setup SSH access
47+
if: ${{ failure() }}
48+
uses: ubicloud/ssh-runner@v1
49+
with:
50+
public-ssh-key: ${{ secrets.SSH_PUBLIC_KEY }}
51+
wait-minutes: 30
52+
```
53+
54+
<Warning>
55+
Store your private SSH key securely. A short debugging session can save massive time, but best practices and security guidelines always apply.
56+
</Warning>
57+
58+
## Conclusion
59+
60+
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.
61+
62+
For more information, visit the [ubicloud/ssh-runner repository](https://github.com/ubicloud/ssh-runner).

0 commit comments

Comments
 (0)