Skip to content

Commit

Permalink
add cicd & docker
Browse files Browse the repository at this point in the history
  • Loading branch information
erayaydogdu committed Dec 11, 2023
1 parent fbba239 commit 00ef6fe
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 13 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/dotnet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@ name: dotnet-cicd
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
push_to_docker:
type: boolean
description: Docker Push
jobs:
build:
name: Build
Expand Down
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Follow one of these steps to set up and run the URL shortener service on your lo

**or run Docker:**
```bash
docker run -p 5148:5148 --name mus erayaydogdu/minimal-url-shortener
docker network create mus || true docker run -p 5148:8080 --name mus --network mus -v data_mus:/app --user root erayaydogdu/minimal-url-shortener
# When the container is up and running you can visit: http://mus:5148/
```

Expand Down
2 changes: 1 addition & 1 deletion src/Frontend/Components/UrlModelDetail.razor
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="flex items-center text-sm">
<div class="">
<a class="font-semibold text-black" href="@Model.ShortUrl">@Model.ShortUrl</a> <br />
<a class="text-xs text-muted" href="@Model.LongUrl">@Model.LongUrl</a>
<a class="text-xs text-muted" href="@Model.LongUrl">@(Model.LongUrl.Length > 75 ? Model.LongUrl.Substring(0,75) + "..." : Model.LongUrl)</a>
</div>
</div>
</td>
Expand Down
3 changes: 0 additions & 3 deletions src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@
);
builder.Services.AddSingleton<ILiteDatabase, LiteDatabase>(_ => new LiteDatabase("minimal-url-shortener.db"));
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
var app = builder.Build();
app.UseSwagger();
app.AddHtmxEndpoints();
var fileOptions = new DefaultFilesOptions();
fileOptions.DefaultFileNames.Clear();
Expand All @@ -33,6 +31,5 @@
{
FileProvider = new PhysicalFileProvider(Path.Combine(app.Environment.ContentRootPath, "Frontend"))
});
app.UseSwaggerUI();
app.UseCors("default-policy");
app.Run();
7 changes: 6 additions & 1 deletion src/minimal-url-shortener.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@
<LangVersion>12</LangVersion>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>

<PropertyGroup>
<ContainerImageName>minimal-url-shortener</ContainerImageName>
<ContainerImageTags>1.0.0;latest</ContainerImageTags>
<ContainerUser>root</ContainerUser>
<PublishProfile>DefaultContainer</PublishProfile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Hashids.net" Version="1.7.0" />
<PackageReference Include="LiteDB" Version="5.0.17" />
Expand Down

0 comments on commit 00ef6fe

Please sign in to comment.