π» Install code-server to run a local VS Code web instance
π Installs code-server
globally
π¨βπ» Host your own VS Code web instance to debug CI
π§ Works on Linux and macOS runners
π No config!
π You will not be able to connect to the localhost:4000
server unless you
use a tunneling service like Try Cloudflare or ngrok to expose the HTTP
server to the rest of the world.
This GitHub Action will install the code-server
binary globally. That means
you can spin up your own local VS Code instance running on the GitHub Actions
runner at any point in your workflow! This is great for diving into a full IDE
(if you need it) to diagnose a problem. For example, debugging the post-build
folder structure and contents of a complex C++ project. Here's a quick demo of
using code-server
& cloudflared
to expose a VS Code web instance to the
entire world via Try Cloudflare.
on: workflow_dispatch
jobs:
code-server:
runs-on: ubuntu-latest
steps:
- uses: jcbhmr/setup-code-server@v1
- uses: debugci/setup-cloudflared@v1
- run: nohup code-server --auth none --bind-addr 0.0.0.0:4000 &
- run: nohup cloudflared tunnel --url http://localhost:4000 &
- run: sleep 5m
π Make sure you check out the code-server documentation for a full list of all the options that you can play around with!
There's currently only a single option to specify the version. Open an Issue if there's more options you'd like to see! β€οΈ
code-server-version
: Which version of code-server to install. This defaults to the latest stable release. Useedge
to download the latest prerelease, or aN.N.N
versions specifier if you wish. Uselatest
(the default) to download the latest version. This field does not support semver specifiers.
This GitHub Action is so simple that we can get away with using plain Bash. To
get started, create a new fork/branch and open a PR! There's some tests in the
test-action.ym
workflow that will run to make sure everything "works".