Skip to content

Commit 2aaa1c8

Browse files
committed
feat: add Kamal deployment configuration
1 parent ab3efcf commit 2aaa1c8

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

.github/workflows/build-container.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
workflows: ["Build"]
88
types:
99
- completed
10+
branches:
11+
- main
12+
- master
1013
workflow_dispatch:
1114

1215
env:
@@ -45,10 +48,10 @@ jobs:
4548
run: |
4649
sed -i 's#<ContainerLabel Include="service" Value="my-app" />#<ContainerLabel Include="service" Value="${{ env.repository_name_lower }}" />#g' MyApp/MyApp.csproj
4750
48-
- name: Check for Client directory
51+
- name: Check for Client directory and package.json
4952
id: check_client
5053
run: |
51-
if [ -d "MyApp.Client" ]; then
54+
if [ -d "MyApp.Client" ] && [ -f "MyApp.Client/package.json" ]; then
5255
echo "client_exists=true" >> $GITHUB_OUTPUT
5356
else
5457
echo "client_exists=false" >> $GITHUB_OUTPUT

.github/workflows/release.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ on:
77
workflows: ["Build Container"]
88
types:
99
- completed
10+
branches:
11+
- main
12+
- master
1013
workflow_dispatch:
1114

1215
env:
@@ -68,7 +71,7 @@ jobs:
6871
bundler-cache: true
6972

7073
- name: Install Kamal
71-
run: gem install kamal -v 2.2.2
74+
run: gem install kamal -v 2.3.0
7275

7376
- name: Set up Docker Buildx
7477
uses: docker/setup-buildx-action@v3

MyApp/MyApp.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<ContainerLabel Include="service" Value="my-app" />
1717
</ItemGroup>
1818

19+
1920
<ItemGroup>
2021
<Using Include="MyApp" />
2122
<Using Include="ServiceStack" />

config/deploy.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ service: my-app
44
# Name of the container image.
55
image: my-user/myapp
66

7+
# Required for use of ASP.NET Core with Kamal-Proxy.
8+
env:
9+
ASPNETCORE_FORWARDEDHEADERS_ENABLED: true
10+
711
# Deploy to these servers.
812
servers:
913
# IP address of server, optionally use env variable.

0 commit comments

Comments
 (0)