diff --git a/.github/workflows/deploy-image.yml b/.github/workflows/deploy-image.yml new file mode 100644 index 0000000..9df6af3 --- /dev/null +++ b/.github/workflows/deploy-image.yml @@ -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 }} diff --git a/Api/Api.csproj b/Api/Api.csproj index b38a69a..9556f5c 100644 --- a/Api/Api.csproj +++ b/Api/Api.csproj @@ -4,6 +4,8 @@ net9.0 enable enable + 1.0.0 + BrianCollet/umami-cloud-api-wrapper diff --git a/Api/Program.cs b/Api/Program.cs index 1157b9d..71f7505 100644 --- a/Api/Program.cs +++ b/Api/Program.cs @@ -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. @@ -35,8 +29,6 @@ }); } -app.UseHttpsRedirection(); - app.UseAuthorization(); app.MapControllers(); diff --git a/Api/appsettings.json b/Api/appsettings.json index 1623d40..10f68b8 100644 --- a/Api/appsettings.json +++ b/Api/appsettings.json @@ -1,11 +1,4 @@ { - "Kestrel": { - "Endpoints": { - "Https": { - "Url": "https://localhost:5001" - } - } - }, "Logging": { "LogLevel": { "Default": "Information",