Skip to content

Commit a351f19

Browse files
committed
Update deploy.yml
1 parent d64f118 commit a351f19

File tree

1 file changed

+26
-11
lines changed

1 file changed

+26
-11
lines changed

config/deploy.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,42 @@
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
7+
# - POSTGRES_PASSWORD (e.g. random-password) - from GitHub Action Secret
38

4-
# Name of the container image.
5-
image: my-user/myapp
9+
# Using environment variables keeps this configuration reusable across multiple apps.
10+
# For a simpler, app-specific setup, you can replace them with hard-coded values.
11+
12+
# Name of your application. Used to uniquely configure containers. (e.g. example-org)
13+
service: <%= ENV['GITHUB_REPOSITORY'].to_s.split('/').last.tr('.', '-') %>
14+
15+
# Name of the container image. (e.g. ghcr.io/acne/example.org)
16+
image: ghcr.io/<%= ENV['GITHUB_REPOSITORY'].to_s.downcase %>
617

718
# Required for use of ASP.NET Core with Kamal-Proxy.
819
env:
9-
ASPNETCORE_FORWARDEDHEADERS_ENABLED: true
20+
clear:
21+
ASPNETCORE_FORWARDEDHEADERS_ENABLED: true
22+
# secrets from ./kamal/secrets
23+
secret:
24+
- SERVICESTACK_LICENSE
1025

1126
# Deploy to these servers.
1227
servers:
13-
# IP address of server, optionally use env variable.
28+
# IP address of server to deploy to. (e.g. 100.100.100.100)
1429
web:
15-
- 192.168.0.1
16-
# - <%= ENV['KAMAL_DEPLOY_IP'] %>
17-
30+
hosts:
31+
- <%= ENV['KAMAL_DEPLOY_IP'] %>
1832

1933
# Enable SSL auto certification via Let's Encrypt (and allow for multiple apps on one server).
2034
# If using something like Cloudflare, it is recommended to set encryption mode
2135
# in Cloudflare's SSL/TLS setting to "Full" to enable end-to-end encryption.
2236
proxy:
2337
ssl: true
24-
host: my-app.example.com
38+
# Hostname to proxy. (e.g. example.org)
39+
host: <%= ENV['KAMAL_DEPLOY_HOST'] %>
2540
# kamal-proxy connects to your container over port 80, use `app_port` to specify a different port.
2641
app_port: 8080
2742

@@ -41,7 +56,7 @@ builder:
4156
arch: amd64
4257

4358
volumes:
44-
- "/opt/docker/MyApp/App_Data:/app/App_Data"
59+
- "/opt/docker/<%= ENV['GITHUB_REPOSITORY'].to_s.split('/').last %>/App_Data:/app/App_Data"
4560

4661
#accessories:
4762
# litestream:

0 commit comments

Comments
 (0)