3 ms·
Show HN: Access a browser running on a GitHub Action runner with free ngrok
It's worth noting the following method will work for any web application, it's just surprising to me that it worked with one which uses WebSockets, WebRTC and has a significant back-end component!
I've recently made an exciting breakthrough with my project, BrowserBox, a remote browser application that uses WebSockets and WebRTC. Amazingly, I was able to run and test it successfully in the context of a GitHub Action, even browsing the web as normal! If you're curious about running your own remote browser for testing purposes, here's how you can do it too:
How can you do this yourself?
1. Fork this repo
https://github.com/dosyago/BrowserBoxPro/fork
2. Add your ngrok auth token to your fork's repository secrets under NGROK_AUTH_TOKEN (you need to sign up for an ngrok free account if you don't have one)
3. Go to your fork's Actions page and run the CI action.
4. Wait a couple minutes for the setup to run and click on the URL produced by the "Print ngrok URL" step in the running action's logs.
5. Play around with the remote browser! Just click on the big + to create a new tab and enter a search query or an address in the address bar and you're away!
IMPORTANT! I'm not sure if this violates the GitHub terms doing this (it may do! Any GitHub employees please email me at cris@dosyago.com and I will remove this Action if it does!), but it's logical that just using this to browse the web would be wasting resources from the Actions runners intended purpose, so don't overdo it! To try to help with this I've set the Action to only run the browser for 5 minutes.
If anyone wants to port this to GitLab or another CI platform, we would very much welcome your contribution!
Anyway, I was really happy and surprised to discover that we can use the generous free compute from Microsoft and GitHub, and the free tunnel from ngrok, to really do some useful things, and you can check up on those and integration test using ngrok and GitHub Actions!
- KomoD 3y agoYes, that does violate their terms I'm pretty sure. It'd probably go under > if using GitHub-hosted runners, any other activity unrelated to the production, testing, deployment, or publication of the software project associated with the repository where GitHub Actions are used > You may only access and use GitHub Actions to develop and test your application(s) or > any activity that places a burden on our servers, where that burden is disproportionate to the benefits provided to users (for example, don't use Actions as a content delivery network or as part of a serverless application, but a low benefit Action could be ok if it’s also low burden)