Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/deploy-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
name: Publish to GitHub Container Registry

on:
push:
branches: ["release"]

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
DOTNET_VERSION: "9.x"

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Publish and push the container image
run: |
dotnet publish --os linux --arch x64 /t:PublishContainer -p ContainerRegistry=${{ env.REGISTRY }}
2 changes: 2 additions & 0 deletions Api/Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<TargetFramework>net9.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<ContainerImageTag>1.0.0</ContainerImageTag>
<ContainerRepository>BrianCollet/umami-cloud-api-wrapper</ContainerRepository>
</PropertyGroup>

<ItemGroup>
Expand Down
8 changes: 0 additions & 8 deletions Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@
options.MaxAge = TimeSpan.FromDays(60);
});

builder.Services.AddHttpsRedirection(options =>
{
options.RedirectStatusCode = Status307TemporaryRedirect;
options.HttpsPort = 5001;
});

var app = builder.Build();

// Configure the HTTP request pipeline.
Expand All @@ -35,8 +29,6 @@
});
}

app.UseHttpsRedirection();

app.UseAuthorization();

app.MapControllers();
Expand Down
7 changes: 0 additions & 7 deletions Api/appsettings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"Kestrel": {
"Endpoints": {
"Https": {
"Url": "https://localhost:5001"
}
}
},
"Logging": {
"LogLevel": {
"Default": "Information",
Expand Down