fly-tailscale-exit
fly-tailscale-exit copied to clipboard
feat: auto deploy to fly.io if auto update exited successfully
feat: auto deploy to fly.io if auto update exited successfully
Origin: https://github.com/patte/fly-tailscale-exit/pull/20.
Note
I have to say sorry that I am too lazy to write this in shell script (I really don't want to parse json in shell lmao), so I switch to all-mighty python.
I switched auto update GitHub Action back to https://github.com/patte/fly-tailscale-exit/commit/41b8bfadbb74d280fad9e1eadbdca0501cd2a158, because the newer version would mark the exit status successful even if there's no version update, and will further invoke auto deploy Action.
The auto deploy Action is only intended to be called if there's a version update detected by auto update or manually by workflow_dispatch
.
Also, the hostname for the machines added to tailnet will need to have the region ID at the end (like fly-lax or com-example-vpn-lax). See https://fly.io/docs/reference/regions/.
Details
I tried this on my own fork, it seem to work really well (updated to 1.28.0). However, the "zero downtime" was not able to achieve due to Tailscale's restriction.
Tailscale treats updated instances as new machine even though the hostname remains the same as specified in start.sh
. This means if there's an old machine called "fly-lax" and it was not deleted before redeploy, a new machine will be added called "fly-lax-1".
Due to above reason, the workflow becomes: auto update -> (if updated) -> remove all machines with matching tag and is in fly.io regions list -> redeploy.