If you want to deploy your project to a server without exposing it or manually managing ssh keys, you can use Tailscale SSH!
Here is a quick guide to using my Github action tailscale-ssh-deploy to deploy files to a server using Tailscale SSH (not normal ssh).
Deploying a static site
For example, we will deploy a Hugo static site using this action
|
|
The relevant part for us are the last two actions. First, we set up Tailscale using an Oauth client ID and secret that you generate in the settings page of your Tailnet more details.
Now make sure you specify the user and use the Tailscale IP address of the server, as I didn’t find using MagicDNS hostnames to be very reliable.
Then you just define the directory to upload to in directory
and where it should be uploaded into remote_destination
You can use post_upload_command
to specify a command to run after a successful upload, as an example I added a command to restart nginx.
That should do it! Now you have a workflow that automatically deploys your project to a server without exposing an ssh service or managing ssh keys!