Skip to content

benhid/deploy-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 

Repository files navigation

Cloud build, local deploy πŸš€

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.

Use cases

  • 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.

Installation

1. Prerequisites

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

2. Generate an ephemeral auth key

Go to Tailscale and create a new reusable ephemeral key and keep it at hand.

3. Configure GitHub Actions secrets

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.

About

Cloud build, local deploy πŸš€

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published