Skip to content

ruie/huiscrawler

 
 

Repository files navigation

⚙️ Deployment

The CI automatically builds and deploys the latest main.

Server setup

The current production server is set up as follows:

Create an ssh key pair for GitHub Actions to use (do not use yourself):

ssh-keygen -t ed25519 -C "[email protected]" -f ci_key

Copy the contents of the file ci_key to a GitHub Actions secret named DEPLOY_SSH_KEY.

Next copy contents of ci_key.pub and edit ~/.ssh/authorized_keys on the server:

# GitHub Action user. Restrict and command options are used to sucurely limit permissions!
restrict,command="/home/adriaan/huiscrawler/deploy" <contents of ci_key.pub>

Make sure to run sudo systemctl restart sshd to reload the authorized_keys file.

Finally, prepare initial deploy config:

ssh [email protected] mkdir -p /home/adriaan/huiscrawler
scp .env.production [email protected]:huiscrawler/.env
scp docker-compose.yml [email protected]:huiscrawler/docker-compose.yml
scp deploy [email protected]:huiscrawler/deploy

# Create a personal access token with read access to container images
# Username is USERNAME, do not edit
ssh [email protected]
docker login ghcr.io -u USERNAME

After that you can deploy normally from ci.

Change env variables or compose file

After changing config in .env.production or docker-compose.yml copy the file to the server with:

scp .env.production [email protected]:huiscrawler/.env

Then do a regular deploy or run docker-compose up -d on the server.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 72.2%
  • HTML 26.5%
  • Dockerfile 1.1%
  • Shell 0.2%