Thanks to Tailscale, you can setup a zero config VPN for building secure networks. We can then use Tailscale to join your Tailscale network and securely access your local server within GitHub Actions using SSH.
-
To test your app using a local database in your server.
-
In combination with watchtower, to automatically update the running version of your containerized app by pushing a new image to your own image registry.
-
With webhook, to execute commands on your server when a workflow (GitHub Action) is triggered.
-
etc.
Create new .ssh
directory to hold the SSH keys and navigate into it:
mkdir -p ~/.ssh
cd ~/.ssh
Generate new authentication key pairs for SSH:
ssh-keygen -m PEM -t rsa -b 4096 -f "github_actions.id_rsa" -q -N ""
Add the public key to the authorized_keys
file to allow SSH connections:
cat github_actions.id_rsa.pub >> authorized_keys
Go to Tailscale and create a new reusable ephemeral key and keep it at hand.
Add two new secrets to your GitHub repository: SSH_KEY
and TAILSCALE_AUTHKEY
, with the SSH private key generated earlier and the Tailscale ephemeral auth key, respectively.