From 92f31eb66646ba014485f56652438642a82f4ab7 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Wed, 26 Mar 2025 20:21:37 +0000 Subject: [PATCH 01/14] Update upload-artifact action --- .github/workflows/DeployServerWebAPI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/DeployServerWebAPI.yml b/.github/workflows/DeployServerWebAPI.yml index 3a3f4a6..4ddd62a 100644 --- a/.github/workflows/DeployServerWebAPI.yml +++ b/.github/workflows/DeployServerWebAPI.yml @@ -26,7 +26,7 @@ jobs: - name: Publish run: dotnet publish "${{ env.WORKING_DIRECTORY }}" --configuration ${{ env.CONFIGURATION }} --no-build --output "${{ env.AZURE_WEBAPP_PACKAGE_PATH }}" - name: Publish Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: webapp path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} From 0903878bedafbce3817ba91e47079ae8b7644070 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 7 Apr 2025 20:50:05 +0100 Subject: [PATCH 02/14] Update download-artifact --- .github/workflows/DeployServerWebAPI.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/DeployServerWebAPI.yml b/.github/workflows/DeployServerWebAPI.yml index 4ddd62a..8bd5456 100644 --- a/.github/workflows/DeployServerWebAPI.yml +++ b/.github/workflows/DeployServerWebAPI.yml @@ -41,7 +41,7 @@ jobs: with: creds: '${{ secrets.AZURE_CREDENTIALS }}' - name: Download artifact from build job - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: webapp path: ${{ env.AZURE_WEBAPP_PACKAGE_PATH }} From 072162c9d62715956381daab56bfc97c9d7173a3 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 7 Apr 2025 22:17:48 +0100 Subject: [PATCH 03/14] Replace deprecated argument --- terraform/blazor_client.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index 4943190..d40ed9e 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -28,7 +28,7 @@ data "cloudflare_zone" "dns_zone" { resource "cloudflare_record" "cname_record" { zone_id = data.cloudflare_zone.dns_zone.id name = local.subdomain - value = azurerm_static_web_app.blazor-client.default_host_name + content = azurerm_static_web_app.blazor-client.default_host_name type = "CNAME" ttl = 3600 } From c3eacd109a459336448c4e01f2f0e2446d6b3008 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 7 Apr 2025 22:40:37 +0100 Subject: [PATCH 04/14] Accomodate existing cloudflare record --- terraform/blazor_client.tf | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index d40ed9e..3665519 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -25,16 +25,21 @@ data "cloudflare_zone" "dns_zone" { name = "dddsouthwest.com" } -resource "cloudflare_record" "cname_record" { - zone_id = data.cloudflare_zone.dns_zone.id - name = local.subdomain - content = azurerm_static_web_app.blazor-client.default_host_name - type = "CNAME" - ttl = 3600 +# resource "cloudflare_record" "cname_record" { +# zone_id = data.cloudflare_zone.dns_zone.id +# name = local.subdomain +# content = azurerm_static_web_app.blazor-client.default_host_name +# type = "CNAME" +# ttl = 3600 +# } + +data "cloudflare_record" "cname_record" { + zone_id = data.cloudflare_zone.dns_zone.id + hostname = azurerm_static_web_app.blazor-client.default_host_name } resource "azurerm_static_web_app_custom_domain" "custom_domain" { static_web_app_id = azurerm_static_web_app.blazor-client.id - domain_name = "${cloudflare_record.cname_record.name}.${data.cloudflare_zone.dns_zone.name}" + domain_name = "${data.cloudflare_record.cname_record.hostname}" validation_type = "cname-delegation" } From 146540bc60cea2b7cf57e2491bd2fe9031725774 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 7 Apr 2025 22:46:43 +0100 Subject: [PATCH 05/14] Fix hostname --- terraform/blazor_client.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index 3665519..428c7ce 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -35,7 +35,7 @@ data "cloudflare_zone" "dns_zone" { data "cloudflare_record" "cname_record" { zone_id = data.cloudflare_zone.dns_zone.id - hostname = azurerm_static_web_app.blazor-client.default_host_name + hostname = "${local.subdomain}.dddsouthwest.com" } resource "azurerm_static_web_app_custom_domain" "custom_domain" { From 7aa71f3bf16e158010124c5bd3f8c2fa0669ddee Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 7 Apr 2025 22:48:32 +0100 Subject: [PATCH 06/14] Switch back to resource --- terraform/blazor_client.tf | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index 428c7ce..3f7b49e 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -25,19 +25,19 @@ data "cloudflare_zone" "dns_zone" { name = "dddsouthwest.com" } -# resource "cloudflare_record" "cname_record" { -# zone_id = data.cloudflare_zone.dns_zone.id -# name = local.subdomain -# content = azurerm_static_web_app.blazor-client.default_host_name -# type = "CNAME" -# ttl = 3600 -# } - -data "cloudflare_record" "cname_record" { - zone_id = data.cloudflare_zone.dns_zone.id - hostname = "${local.subdomain}.dddsouthwest.com" +resource "cloudflare_record" "cname_record" { + zone_id = data.cloudflare_zone.dns_zone.id + name = local.subdomain + content = azurerm_static_web_app.blazor-client.default_host_name + type = "CNAME" + ttl = 3600 } +# data "cloudflare_record" "cname_record" { +# zone_id = data.cloudflare_zone.dns_zone.id +# hostname = "${local.subdomain}.dddsouthwest.com" +# } + resource "azurerm_static_web_app_custom_domain" "custom_domain" { static_web_app_id = azurerm_static_web_app.blazor-client.id domain_name = "${data.cloudflare_record.cname_record.hostname}" From 2a8d98759a878d7f172ad55cc4bf1e7090b867a4 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 7 Apr 2025 22:50:22 +0100 Subject: [PATCH 07/14] Fix broken reference --- terraform/blazor_client.tf | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index 3f7b49e..6f43f08 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -33,13 +33,19 @@ resource "cloudflare_record" "cname_record" { ttl = 3600 } +resource "azurerm_static_web_app_custom_domain" "custom_domain" { + static_web_app_id = azurerm_static_web_app.blazor-client.id + domain_name = "${cloudflare_record.cname_record.hostname}" + validation_type = "cname-delegation" +} + # data "cloudflare_record" "cname_record" { # zone_id = data.cloudflare_zone.dns_zone.id # hostname = "${local.subdomain}.dddsouthwest.com" # } -resource "azurerm_static_web_app_custom_domain" "custom_domain" { - static_web_app_id = azurerm_static_web_app.blazor-client.id - domain_name = "${data.cloudflare_record.cname_record.hostname}" - validation_type = "cname-delegation" -} +# resource "azurerm_static_web_app_custom_domain" "custom_domain" { +# static_web_app_id = azurerm_static_web_app.blazor-client.id +# domain_name = "${data.cloudflare_record.cname_record.hostname}" +# validation_type = "cname-delegation" +# } From a8937bd6beadda0feff6b15dfbf60fd0017b6b75 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 14 Apr 2025 20:13:03 +0100 Subject: [PATCH 08/14] Uncomment DNS records! --- terraform/blazor_client.tf | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index 6f43f08..7f0b85f 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -39,13 +39,13 @@ resource "azurerm_static_web_app_custom_domain" "custom_domain" { validation_type = "cname-delegation" } -# data "cloudflare_record" "cname_record" { -# zone_id = data.cloudflare_zone.dns_zone.id -# hostname = "${local.subdomain}.dddsouthwest.com" -# } - -# resource "azurerm_static_web_app_custom_domain" "custom_domain" { -# static_web_app_id = azurerm_static_web_app.blazor-client.id -# domain_name = "${data.cloudflare_record.cname_record.hostname}" -# validation_type = "cname-delegation" -# } +data "cloudflare_record" "cname_record" { + zone_id = data.cloudflare_zone.dns_zone.id + hostname = "${local.subdomain}.dddsouthwest.com" +} + +resource "azurerm_static_web_app_custom_domain" "custom_domain" { + static_web_app_id = azurerm_static_web_app.blazor-client.id + domain_name = "${data.cloudflare_record.cname_record.hostname}" + validation_type = "cname-delegation" +} From 5a74d75f469d9bfaea09b5623d178352ded35944 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 14 Apr 2025 20:14:26 +0100 Subject: [PATCH 09/14] Switch back to resource --- terraform/blazor_client.tf | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index 7f0b85f..6f43f08 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -39,13 +39,13 @@ resource "azurerm_static_web_app_custom_domain" "custom_domain" { validation_type = "cname-delegation" } -data "cloudflare_record" "cname_record" { - zone_id = data.cloudflare_zone.dns_zone.id - hostname = "${local.subdomain}.dddsouthwest.com" -} - -resource "azurerm_static_web_app_custom_domain" "custom_domain" { - static_web_app_id = azurerm_static_web_app.blazor-client.id - domain_name = "${data.cloudflare_record.cname_record.hostname}" - validation_type = "cname-delegation" -} +# data "cloudflare_record" "cname_record" { +# zone_id = data.cloudflare_zone.dns_zone.id +# hostname = "${local.subdomain}.dddsouthwest.com" +# } + +# resource "azurerm_static_web_app_custom_domain" "custom_domain" { +# static_web_app_id = azurerm_static_web_app.blazor-client.id +# domain_name = "${data.cloudflare_record.cname_record.hostname}" +# validation_type = "cname-delegation" +# } From 18a149608710dd91954cc99191d21afc55cd4f3d Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 14 Apr 2025 20:16:21 +0100 Subject: [PATCH 10/14] Allow manual trigger of main and branch workflows --- .github/workflows/DeployBranchPush.yml | 1 + .github/workflows/DeployMainBranch.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/DeployBranchPush.yml b/.github/workflows/DeployBranchPush.yml index 26a0a7d..10b7a1a 100644 --- a/.github/workflows/DeployBranchPush.yml +++ b/.github/workflows/DeployBranchPush.yml @@ -1,5 +1,6 @@ name: Deploy Branch Push on: + workflow_dispatch: push: branches-ignore: - 'main' diff --git a/.github/workflows/DeployMainBranch.yml b/.github/workflows/DeployMainBranch.yml index 5c70caf..d7cb16d 100644 --- a/.github/workflows/DeployMainBranch.yml +++ b/.github/workflows/DeployMainBranch.yml @@ -1,5 +1,6 @@ name: Deploy Main to Production on: + workflow_dispatch: push: branches: - 'main' From 42827acf3132f3dd636bd9716cea3b106fa4183f Mon Sep 17 00:00:00 2001 From: Russell Day Date: Mon, 14 Apr 2025 20:23:08 +0100 Subject: [PATCH 11/14] Remove obsolete comments --- terraform/blazor_client.tf | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/terraform/blazor_client.tf b/terraform/blazor_client.tf index 6f43f08..e14041e 100644 --- a/terraform/blazor_client.tf +++ b/terraform/blazor_client.tf @@ -38,14 +38,3 @@ resource "azurerm_static_web_app_custom_domain" "custom_domain" { domain_name = "${cloudflare_record.cname_record.hostname}" validation_type = "cname-delegation" } - -# data "cloudflare_record" "cname_record" { -# zone_id = data.cloudflare_zone.dns_zone.id -# hostname = "${local.subdomain}.dddsouthwest.com" -# } - -# resource "azurerm_static_web_app_custom_domain" "custom_domain" { -# static_web_app_id = azurerm_static_web_app.blazor-client.id -# domain_name = "${data.cloudflare_record.cname_record.hostname}" -# validation_type = "cname-delegation" -# } From 09d8d7263e4c5c853366c825d2b4f8b577c65acd Mon Sep 17 00:00:00 2001 From: Russell Day Date: Tue, 15 Apr 2025 21:32:04 +0100 Subject: [PATCH 12/14] Change push deploy to point to dev --- .github/workflows/DeployBranchPush.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/DeployBranchPush.yml b/.github/workflows/DeployBranchPush.yml index 10b7a1a..8386b3e 100644 --- a/.github/workflows/DeployBranchPush.yml +++ b/.github/workflows/DeployBranchPush.yml @@ -6,10 +6,10 @@ on: - 'main' jobs: - deploy_to_test: + deploy_to_dev: uses: ./.github/workflows/DeployEverything.yml with: - env: "Test2" + env: "dev" secrets: AZURE_CREDENTIALS: ${{ secrets.AZURE_CREDENTIALS }} AZURE_STATIC_WEB_APPS_API_TOKEN: ${{ secrets.AZURE_STATIC_WEB_APPS_API_TOKEN }} From 18577184fc5031fb2e4b2da290369902ddf55591 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Tue, 15 Apr 2025 21:36:02 +0100 Subject: [PATCH 13/14] Appropriate Test env for dev --- tfvars/{Test.tfvars => dev.tfvars} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename tfvars/{Test.tfvars => dev.tfvars} (91%) diff --git a/tfvars/Test.tfvars b/tfvars/dev.tfvars similarity index 91% rename from tfvars/Test.tfvars rename to tfvars/dev.tfvars index 484b4d8..52b2019 100644 --- a/tfvars/Test.tfvars +++ b/tfvars/dev.tfvars @@ -1,4 +1,4 @@ -env = "test" +env = "dev" sql_db_sku = "Basic" sql_max_storage = "2" api_app_service_sku = "F1" From b6ce13b5c0983e811acf13140e84014444195993 Mon Sep 17 00:00:00 2001 From: Russell Day Date: Tue, 15 Apr 2025 21:46:34 +0100 Subject: [PATCH 14/14] Replace test appsettings with dev --- .../PocketDDD.BlazorClient/wwwroot/appsettings.dev.json | 4 ++++ .../PocketDDD.BlazorClient/wwwroot/appsettings.test.json | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.dev.json delete mode 100644 PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.test.json diff --git a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.dev.json b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.dev.json new file mode 100644 index 0000000..7333da4 --- /dev/null +++ b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.dev.json @@ -0,0 +1,4 @@ +{ + "apiUrl": "https://pocketddd-dev-api-server-web-app.azurewebsites.net/api/", + "fakeBackend": false +} \ No newline at end of file diff --git a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.test.json b/PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.test.json deleted file mode 100644 index f327669..0000000 --- a/PocketDDD.BlazorClient/PocketDDD.BlazorClient/wwwroot/appsettings.test.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "apiUrl": "https://pocketddd-test-api-server-web-app.azurewebsites.net/api/", - "fakeBackend": false -} \ No newline at end of file