File tree Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Expand file tree Collapse file tree 2 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1+ name : Run HTML Tests
2+ on :
3+ # Runs on pushes targeting the default branch
4+ push :
5+ branches : ["test-createLatest"]
6+ jobs :
7+ htmltest :
8+ runs-on : ubuntu-latest
9+ env :
10+ HUGO_VERSION : 0.110.0
11+ concurrency :
12+ group : ${{ github.workflow }}-${{ github.ref }}
13+ steps :
14+ - name : Update Latest Content
15+ run : |
16+ ..\..\createLatest.ps1
Original file line number Diff line number Diff line change 1- Remove-item - ItemType Directory - Path " content/en/docs/latest/" - Force
2- New-Item - ItemType Directory - Path " content/en/docs/latest/" - Force
3- Copy-Item - Path " content/en/docs/2024.11/*" - Destination " content/en/docs/latest/" - Recurse - Force
1+ $Path = " .\config\_default\config.toml"
2+ $latestName = " latest"
3+
4+ $LatestVersion = (Select-String - Path $Path - Pattern " latest = true" - Context 3 , 0 ) -split " `" "
5+
6+ # Use $LatestVersion[1] as we know that the version is the first line returned and splitting on " makes it the 2nd index
7+ $Version = $LatestVersion [1 ]
8+
9+ if (Test-Path " .\content\en\docs\$latestName " ){
10+ Remove-Item - LiteralPath " .\content\en\docs\$latestName " - Force - Recurse
11+ }
12+ New-Item - ItemType Directory - Path " .\content\en\docs\$latestName \" - Force
13+ Copy-Item - Path " .\content\en\docs\$Version \*" - Destination " .\content\en\docs\$latestName \" - Recurse - Force
14+ (Get-Content .\content\en\docs\latest\_index.md) -replace $Version , " Latest" | Set-Content .\content\en\docs\latest\_index.md
15+
16+ New-Item - ItemType Directory - Path " .\content\static\$latestName \" - Force
17+ Copy-Item - Path " .\content\static\$Version \*" - Destination " .\content\static\$latestName \" - Recurse - Force
You can’t perform that action at this time.
0 commit comments