Automatic update Hugo server powered by Caddy
Generate a new deployment key pair
$ ssh-keygen -f ./.ssh/id_rsa
This will generate you a new key pair (./.ssh/id_rsa, ./.ssh/id_rsa.pub)
Move ./Caddyfile.example to ./Caddyfile
Edit ./Caddyfile, replace the constants
{YOUR_REPO_URL}: Your Git repositories's SSH url
{YOUR_HOOK_URL}: The path you want the hook listener to bind, which can be access outside
{YOUR_HOOK_SECRET}: The secret, you can generate it as following
openssl rand -base64 32
Add ./.ssh/id_rsa.pub to your repo's deploy keys, ensure it has READ access
Add {YOUR_HOOK_URL}'s full path that can be access outside to your Git webhook config, with secret {YOUR_HOOK_SECRET}
docker-compose up -d
If you want pre-built images, replace following line in docker-compose.yml
build: .
with
image: forewing/hugo-caddy
Content type
Image
Digest
Size
50 MB
Last updated
about 6 years ago
docker pull forewing/hugo-caddy