Skip to content

Commit

Permalink
Updated workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
nenad0707 committed Jun 4, 2024
1 parent 3ada237 commit dddec21
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/azure-static-web-apps-proud-meadow-0ae800f0f.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ jobs:
with:
submodules: true
lfs: false
- name: Build And Deploy
id: builddeploy
- name: Set up .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: "6.0.x" # ili verzija koju koristite
- name: Restore dependencies
run: dotnet restore ./TaskTackler
- name: Build
run: dotnet build --configuration Release --no-restore ./TaskTackler
- name: Deploy
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
Expand All @@ -29,15 +36,14 @@ jobs:
app_location: "./TaskTackler" # App source code path
output_location: "wwwroot" # Built app content directory - optional
env:
ApiUrl: ${{secrets.API_URL}}
ApiUrl: ${{ secrets.API_URL }}

close_pull_request_job:
if: github.event_name == 'pull_request' && github.event.action == 'closed'
runs-on: ubuntu-latest
name: Close Pull Request Job
steps:
- name: Close Pull Request
id: closepullrequest
uses: Azure/static-web-apps-deploy@v1
with:
azure_static_web_apps_api_token: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }}
Expand Down
4 changes: 3 additions & 1 deletion TaskTackler/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
builder.Services.AddScoped<AuthorizationMessageHandler>();
builder.Services.AddScoped<CachingHandler>();

var apiUrl = Environment.GetEnvironmentVariable("ApiUrl")
?? builder.Configuration.GetValue<string>("ApiUrl")
?? "https://localhost:7213/api/";

var apiUrl = builder.Configuration.GetValue<string>("ApiUrl") ?? "https://localhost:7213/api/";
builder.Services.AddHttpClient("api", client =>
{
client.BaseAddress = new Uri(apiUrl);
Expand Down

0 comments on commit dddec21

Please sign in to comment.