-
-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (33 loc) · 1.28 KB
/
tailscale-code-tunnel.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
name: tailscale-code-tunnel
on:
workflow_dispatch:
jobs:
code-test:
runs-on: ubuntu-24.04
steps:
- name: Remove unwanted stuff
uses: gbraad-devenv/remove-unwanted@v1
- name: Run system container with `podman`
run: |
podman run -d --name code --hostname code-${HOSTNAME} --systemd=always --cap-add=NET_RAW --cap-add=NET_ADMIN --cap-add=SYS_ADMIN --device=/dev/net/tun --device=/dev/fuse ghcr.io/gbraad-devenv/debian/code-cli:bookworm
- name: Tailscale setup (root)
run: |
until podman exec code tailscale up --auth-key ${TAILSCALE_AUTHKEY} --ssh
do
sleep 0.1
done
env:
TAILSCALE_AUTHKEY: ${{ secrets.TAILSCALE_AUTHKEY}}
- name: Start `code tunnel` as `gbraad`
run: |
podman exec code su - gbraad -c "code tunnel user login --provider github"
podman exec code systemctl enable --now code-tunnel@gbraad
- name: Hang around
run: |
until podman exec code systemctl is-active --quiet code-tunnel@gbraad
do
sleep 1
done
echo "Open in a browser: https://vscode.dev/tunnel/code-${HOSTNAME}"
echo "or connect to tunnel: code-${HOSTNAME} using VS Code"
sleep infinity