Skip to content

Commit c2fb1be

Browse files
authored
Fix for Sitemap (#2846)
👷 ci(workflow): update token replacement and environment variables - add support for .yml files in token replacement - introduce GitHub.PullRequestNumber environment variable - add log for HUGO_ENV setup 🌐 i18n(hugo): update baseURL configuration for environments - set baseURL for canary, preview, and production environments - retain empty baseURL for local development - ensure baseURL consistency across hugo configuration files
2 parents 0f07430 + 5eba4a3 commit c2fb1be

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

.github/workflows/main.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,14 +465,15 @@ jobs:
465465
- uses: actions/checkout@v4
466466
- uses: cschleiden/replace-tokens@v1
467467
with:
468-
files: '["**/*.html", "**/*.yaml"]'
468+
files: '["**/*.html", "**/*.yaml", "**/*.yml"]'
469469
tokenPrefix: "#{"
470470
tokenSuffix: "}#"
471471
env:
472472
GitVersion_SemVer: ${{ needs.Setup.outputs.GitVersion_SemVer }}
473473
GitVersion_AssemblySemVer: ${{ needs.Setup.outputs.GitVersion_AssemblySemVer }}
474474
GitVersion_InformationalVersion: ${{ needs.Setup.outputs.GitVersion_InformationalVersion }}
475475
GitVersion.SemVer: ${{ needs.Setup.outputs.GitVersion_SemVer }}
476+
GitHub.PullRequestNumber: ${{ github.event.pull_request.number || '0' }}
476477
- name: Setup Hugo
477478
uses: peaceiris/actions-hugo@v3
478479
with:
@@ -483,7 +484,10 @@ jobs:
483484
$environment = "${{ needs.Setup.outputs.nkdAgility_Ring }}".ToLower()
484485
Write-Host "Building site for $environment ";
485486
$env:HUGO_ENV = "$environment";
486-
hugo --source docs --config hugo.yaml,hugo.$environment.yaml --logLevel debug; # --minify
487+
Write-Host "HUGO_ENV is set to $env:HUGO_ENV"
488+
$configFiles = "hugo.yaml,hugo.$environment.yaml"
489+
Write-Host "Using config files: $configFiles"
490+
hugo --source docs --config $configFiles --logLevel debug;
487491
- uses: actions/upload-artifact@v4
488492
with:
489493
name: AzureDevOpsMigrationTools-Site2

docs/hugo.canary.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1+
baseURL: "https://blue-river-093197403-#{GitHub.PullRequestNumber}#.westeurope.5.azurestaticapps.net/"
12
environment: "canary"
23
minifyOutput: true
34

45
buildDrafts: true
56
buildFuture: true
67
buildExpired: true
8+
9+
10+
# PullRequestNumber

docs/hugo.local.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1+
baseURL: ""
12
Environment: "development"
23

34
buildDrafts: true
45
buildFuture: true
5-
buildExpired: true
6+
buildExpired: true``
67

78
disableAliases: true

docs/hugo.preview.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
baseURL: "https://blue-river-093197403-preview.westeurope.5.azurestaticapps.net/"
12
Environment: "preview"
23
minifyOutput: true
34

docs/hugo.production.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseURL: https://devopsmigration.io/
1+
22
Environment: "production"
33
minifyOutput: true
44

docs/hugo.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
title: Azure DevOps Migration Tools
2+
baseURL: https://devopsmigration.io/
23

34
publishDir: ../public
45
resourceDir: ../resources

0 commit comments

Comments
 (0)