|
| 1 | +# <% require "dotenv"; Dotenv.load(".env") %> |
1 | 2 | # 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 |
8 | | - |
| 3 | +# - GITHUB_REPOSITORY (e.g. acme/example.org) - from GitHub Action ${github.repository} |
| 4 | +# SERVICE (e.g. example-org) |
| 5 | +# IMAGE (e.g. ghcr.io/acme/example.org) |
| 6 | +# - KAMAL_REGISTRY_USERNAME (e.g. my-user) - from GitHub Action ${github.actor} |
| 7 | +# - KAMAL_REGISTRY_PASSWORD ($GITHUB_TOKEN) - from GitHub Action ${secrets.GITHUB_TOKEN} |
| 8 | +# - KAMAL_DEPLOY_IP (e.g. 100.100.100.100) - from GitHub Action Secret |
| 9 | +# - KAMAL_DEPLOY_HOST (e.g. example.org) - from GitHub Action Secret |
| 10 | +# - POSTGRES_PASSWORD (e.g. random-password) - from GitHub Action Secret |
| 11 | +# |
9 | 12 | # 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. |
| 13 | +# For a simpler app-specific setup (without needing .env), they can be replaced with hard-coded values. |
11 | 14 |
|
12 | 15 | # Name of your application. Used to uniquely configure containers. (e.g. example-org) |
13 | | -service: <%= ENV['GITHUB_REPOSITORY'].to_s.split('/').last.tr('.', '-') %> |
| 16 | +service: <%= ENV['SERVICE'] %> |
14 | 17 |
|
15 | | -# Name of the container image. (e.g. ghcr.io/acne/example.org) |
16 | | -image: ghcr.io/<%= ENV['GITHUB_REPOSITORY'].to_s.downcase %> |
| 18 | +# Name of the container image. (e.g. ghcr.io/acme/example.org) |
| 19 | +image: <%= ENV['IMAGE'] %> |
17 | 20 |
|
18 | 21 | # Required for use of ASP.NET Core with Kamal-Proxy. |
19 | 22 | env: |
|
22 | 25 | # secrets from ./kamal/secrets |
23 | 26 | secret: |
24 | 27 | - SERVICESTACK_LICENSE |
| 28 | + - APPSETTINGS_JSON_BASE64 |
25 | 29 |
|
26 | 30 | # Deploy to these servers. |
27 | 31 | servers: |
@@ -56,7 +60,7 @@ builder: |
56 | 60 | arch: amd64 |
57 | 61 |
|
58 | 62 | volumes: |
59 | | - - "/opt/docker/<%= ENV['GITHUB_REPOSITORY'].to_s.split('/').last %>/App_Data:/app/App_Data" |
| 63 | + - "/opt/docker/<%= ENV['SERVICE'] %>/App_Data:/app/App_Data" |
60 | 64 |
|
61 | 65 | #accessories: |
62 | 66 | # litestream: |
|
0 commit comments