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
9 changes: 9 additions & 0 deletions .github/workflows/deployapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.x'

- name: Update database
run: |
dotnet tool install --global dotnet-ef --version 9.*
dotnet tool restore
dotnet ef --project TickAPI/TickAPI/TickAPI.csproj database update
env:
ConnectionStrings__DefaultConnection: ${{ secrets.RESELLIO_DB_CONNECTION_STRING }}

- name: Build with dotnet
run: dotnet build TickAPI/TickAPI/TickAPI.csproj --configuration Release
Expand All @@ -34,6 +42,7 @@ jobs:
with:
name: .net-app
path: ${{env.DOTNET_ROOT}}/myapp


deploy:
runs-on: windows-latest
Expand Down
7 changes: 6 additions & 1 deletion TickAPI/TickAPI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@
})
.AddGoogle(options =>
{
options.ClientId = builder.Configuration["Authentication:Google:ClientId"];

Check warning on line 55 in TickAPI/TickAPI/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference assignment.
options.ClientSecret = builder.Configuration["Authentication:Google:ClientSecret"];

Check warning on line 56 in TickAPI/TickAPI/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference assignment.
})
.AddJwtBearer(options =>
{
Expand All @@ -65,7 +65,7 @@
ValidateIssuerSigningKey = true,
ValidIssuer = builder.Configuration["Authentication:Jwt:Issuer"],
IssuerSigningKey = new SymmetricSecurityKey(
Encoding.UTF8.GetBytes(builder.Configuration["Authentication:Jwt:SecurityKey"]))

Check warning on line 68 in TickAPI/TickAPI/Program.cs

View workflow job for this annotation

GitHub Actions / build

Possible null reference argument for parameter 's' in 'byte[] Encoding.GetBytes(string s)'.
};
});

Expand Down Expand Up @@ -146,7 +146,12 @@

builder.Services.AddDbContext<TickApiDbContext>(options =>
{
options.UseSqlServer(builder.Configuration.GetConnectionString("ResellioDatabase"));
options.UseSqlServer(builder.Configuration.GetConnectionString("ResellioDatabase"),
sqlOptions =>
sqlOptions.EnableRetryOnFailure(
maxRetryCount: 5,
maxRetryDelay: TimeSpan.FromSeconds(30),
errorNumbersToAdd: null));
});

// Create CORS policy
Expand Down
Loading