1- # Name of your application. Used to uniquely configure containers.
2- service : my-app
1+ # Kamal deploy config for this repository. Uses environment variables:
2+ # - GITHUB_REPOSITORY (e.g. acme/example.org) - from GitHub Action ${github.repository}
3+ # - KAMAL_REGISTRY_USERNAME (e.g. my-user) - from GitHub Action ${github.actor}
4+ # - KAMAL_REGISTRY_PASSWORD ($GITHUB_TOKEN) - from GitHub Action ${secrets.GITHUB_TOKEN}
5+ # - KAMAL_DEPLOY_IP (e.g. 100.100.100.100) - from GitHub Action Secret
6+ # - KAMAL_DEPLOY_HOST (e.g. example.org) - from GitHub Action Secret
37
4- # Name of the container image.
5- image : my-user/myapp
8+ # Using environment variables keeps this configuration reusable across multiple apps.
9+ # For a simpler, app-specific setup, you can replace them with hard-coded values.
10+
11+ # Name of your application. Used to uniquely configure containers. (e.g. example-org)
12+ service : <%= ENV['GITHUB_REPOSITORY'].to_s.split('/').last.tr('.', '-') %>
13+
14+ # Name of the container image. (e.g. ghcr.io/acne/example.org)
15+ image : ghcr.io/<%= ENV['GITHUB_REPOSITORY'].to_s.downcase %>
616
717# Required for use of ASP.NET Core with Kamal-Proxy.
818env :
919 clear :
1020 ASPNETCORE_FORWARDEDHEADERS_ENABLED : true
21+ # secrets from ./kamal/secrets
1122 secret :
1223 - SERVICESTACK_LICENSE
1324
1425# Deploy to these servers.
1526servers :
16- # IP address of server, optionally use env variable.
27+ # IP address of server to deploy to. (e.g. 100.100.100.100)
1728 web :
18- - 192.168.0.1
19- # - <%= ENV['KAMAL_DEPLOY_IP'] %>
20-
29+ hosts :
30+ - <%= ENV['KAMAL_DEPLOY_IP'] %>
2131
2232# Enable SSL auto certification via Let's Encrypt (and allow for multiple apps on one server).
2333# If using something like Cloudflare, it is recommended to set encryption mode
2434# in Cloudflare's SSL/TLS setting to "Full" to enable end-to-end encryption.
2535proxy :
2636 ssl : true
27- host : my-app.example.com
37+ # Hostname to proxy. (e.g. example.org)
38+ host : <%= ENV['KAMAL_DEPLOY_HOST'] %>
2839 # kamal-proxy connects to your container over port 80, use `app_port` to specify a different port.
2940 app_port : 8080
3041
@@ -44,7 +55,7 @@ builder:
4455 arch : amd64
4556
4657volumes :
47- - " /opt/docker/MyApp /App_Data:/app/App_Data"
58+ - " /opt/docker/<%= ENV['GITHUB_REPOSITORY'].to_s.split('/').last % > /App_Data:/app/App_Data"
4859
4960# accessories:
5061# litestream:
0 commit comments