Skip to content

Commit

Permalink
feat: add Kamal deployment configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Layoric committed Nov 21, 2024
1 parent ab3efcf commit 2aaa1c8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/build-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
workflows: ["Build"]
types:
- completed
branches:
- main
- master
workflow_dispatch:

env:
Expand Down Expand Up @@ -45,10 +48,10 @@ jobs:
run: |
sed -i 's#<ContainerLabel Include="service" Value="my-app" />#<ContainerLabel Include="service" Value="${{ env.repository_name_lower }}" />#g' MyApp/MyApp.csproj
- name: Check for Client directory
- name: Check for Client directory and package.json
id: check_client
run: |
if [ -d "MyApp.Client" ]; then
if [ -d "MyApp.Client" ] && [ -f "MyApp.Client/package.json" ]; then
echo "client_exists=true" >> $GITHUB_OUTPUT
else
echo "client_exists=false" >> $GITHUB_OUTPUT
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
workflows: ["Build Container"]
types:
- completed
branches:
- main
- master
workflow_dispatch:

env:
Expand Down Expand Up @@ -68,7 +71,7 @@ jobs:
bundler-cache: true

- name: Install Kamal
run: gem install kamal -v 2.2.2
run: gem install kamal -v 2.3.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
1 change: 1 addition & 0 deletions MyApp/MyApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<ContainerLabel Include="service" Value="my-app" />
</ItemGroup>


<ItemGroup>
<Using Include="MyApp" />
<Using Include="ServiceStack" />
Expand Down
4 changes: 4 additions & 0 deletions config/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ service: my-app
# Name of the container image.
image: my-user/myapp

# Required for use of ASP.NET Core with Kamal-Proxy.
env:
ASPNETCORE_FORWARDEDHEADERS_ENABLED: true

# Deploy to these servers.
servers:
# IP address of server, optionally use env variable.
Expand Down

0 comments on commit 2aaa1c8

Please sign in to comment.