Skip to content

Latest commit

 

History

History
74 lines (55 loc) · 3.11 KB

README.md

File metadata and controls

74 lines (55 loc) · 3.11 KB

Setup Coder code-server

💻 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
⚠️ Not recommended as your primary IDE
🚀 No config!

Usage

GitHub Actions GitHub

🛑 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!

⚠️ Make sure you're aware of the limits of GitHub Actions!

Options

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. Use edge to download the latest prerelease, or a N.N.N versions specifier if you wish. Use latest (the default) to download the latest version. This field does not support semver specifiers.

Development

GNU Bash

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