Skip to content

Commit 98c2e63

Browse files
authored
Update README.md
1 parent 2c048d6 commit 98c2e63

1 file changed

Lines changed: 58 additions & 8 deletions

File tree

README.md

Lines changed: 58 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,75 @@
1-
# Setup code-server
1+
# Setup Coder code-server
22

33
💻 Install [code-server] to run a local VS Code web instance
44

5+
<div align="center">
6+
7+
![](https://github.com/ttyci/setup-code-server/assets/61068799/8065c44f-2c7c-4925-bb45-b7b788c2d417)
8+
9+
</div>
10+
11+
🌎 Installs `code-server` globally \
12+
👨‍💻 Host your own VS Code web instance to debug CI \
13+
🐧 Works on Linux and macOS runners \
14+
⚠️ Not recommended for extended use \
15+
🚀 No config!
16+
517
## Usage
618

19+
![GitHub Actions](https://img.shields.io/static/v1?style=for-the-badge&message=GitHub+Actions&color=2088FF&logo=GitHub+Actions&logoColor=FFFFFF&label=)
20+
![GitHub](https://img.shields.io/static/v1?style=for-the-badge&message=GitHub&color=181717&logo=GitHub&logoColor=FFFFFF&label=)
21+
22+
🛑 You will **not be able to connect** to the `localhost:4000` server unless you
23+
use a tunneling service like [Try Cloudflare] or [ngrok].
24+
25+
This GitHub Action will install the `code-server` binary globally. That means
26+
you can spin up your own local VS Code instance running _on the GitHub Actions
27+
runner_ at any point in your workflow! This is great for diving into a full IDE
28+
(if you need it) to diagnose a problem. For example, debugging the post-build
29+
folder structure and contents of a complex C++ project. Here's a quick demo of
30+
using `code-server` & `cloudflared` to expose a VS Code web instance to the
31+
entire world via [Try Cloudflare].
32+
733
```yml
8-
on: push
34+
on: workflow_dispatch
935
jobs:
1036
code-server:
1137
runs-on: ubuntu-latest
1238
steps:
13-
- uses: cidebug/setup-code-server@v1
14-
- uses: cidebug/setup-cloudflare-tunnel@v1
15-
- run: |
16-
code-server --auth none --bind-addr 0.0.0.0:4000 &
17-
cloudflared tunnel --url http://localhost:4000 &
18-
wait -n
39+
- uses: ttyci/setup-code-server@v1
40+
- uses: ttyci/setup-cloudflared@v1
41+
- run: nohup code-server --auth none --bind-addr 0.0.0.0:4000 &
42+
- run: nohup cloudflared tunnel --url http://localhost:4000 &
43+
- run: sleep 5m
1944
```
2045
2146
📚 Make sure you check out [the code-server documentation] for a full list of
2247
all the options that you can play around with!
2348
49+
⚠️ Make sure you're aware of [the limits of GitHub Actions]!
50+
51+
### Options
52+
53+
There's currently only a single option to specify the version. Let me know if
54+
there's more options you'd like to see! ❤️
55+
56+
- **`code-server-version`:** The specific pinned version of the `code-server`
57+
binary to install. This can also be the string `latest` to automatically
58+
install the latest version. Also supports the `edge` value to install
59+
prerelease versions. The default is `latest`.
60+
61+
## Development
62+
63+
![GNU Bash](https://img.shields.io/static/v1?style=for-the-badge&message=GNU+Bash&color=4EAA25&logo=GNU+Bash&logoColor=FFFFFF&label=)
64+
65+
This GitHub Action is so simple that we can get away with using plain Bash. To
66+
get started, create a new fork/branch and open a PR! There's some tests in the
67+
`test-action.ym` workflow that will run to make sure everything "works".
68+
69+
<!-- prettier-ignore-start -->
2470
[code-server]: https://github.com/coder/code-server
2571
[the code-server documentation]: https://coder.com/docs/code-server/latest/guide
72+
[try cloudflare]: https://try.cloudflare.com/
73+
[the limits of GitHub Actions]: https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration
74+
[ngrok]: https://ngrok.com/
75+
<!-- prettier-ignore-end -->

0 commit comments

Comments
 (0)