Skip to content

Commit d83025f

Browse files
authored
Rewrite GitHub Pages Publish to use official action (#708)
* Rewrite GitHub Pages Publish to use official action * Update pipeline templates to latest * Fix Indent * Update image names to match new template values
1 parent a25e569 commit d83025f

File tree

3 files changed

+31
-33
lines changed

3 files changed

+31
-33
lines changed

.github/workflows/publish-docs.yml

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,34 @@
11
name: Publish GH - Pages
2+
# Based on https://github.com/actions/starter-workflows/blob/main/pages/static.yml
23

4+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
35
permissions:
46
contents: read
57
pages: write
8+
id-token: write
9+
10+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
11+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
12+
concurrency:
13+
group: "pages"
14+
cancel-in-progress: false
615

716
on:
817
push:
9-
branches: [ main, release/v2.2, release/v2.3 ]
10-
18+
branches: [ release/v2.3 ]
19+
# Allows you to run this workflow manually from the Actions tab
20+
workflow_dispatch:
1121
jobs:
12-
build:
13-
22+
deploy:
23+
environment:
24+
name: github-pages
25+
url: ${{ steps.deployment.outputs.page_url }}
1426
runs-on: windows-latest
1527

1628
steps:
17-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v4
1830
with:
1931
fetch-depth: 0
20-
- name: Set Docs Locations
21-
id: branch
22-
run: |
23-
$branchName = "${{ github.ref }}"
24-
# refs/heads/ is 11 characters
25-
$branchName = $branchName.Substring(11)
26-
27-
if($branchName.StartsWith("release/"))
28-
{
29-
$branchName = $branchName.Substring(8)
30-
}
31-
elseif ($branchName -eq "main")
32-
{
33-
$branchName = ""
34-
}
35-
echo "::set-output name=DOCS_LOCATION::$branchName"
3632
- name: Setup .NET Core
3733
uses: actions/setup-dotnet@v1
3834
with:
@@ -43,11 +39,13 @@ jobs:
4339
run: choco install docfx
4440
- name: Run DocFx
4541
run: docfx docfx/docfx.json
46-
- name: Upload to GitHub Pages
47-
uses: peaceiris/[email protected]
42+
- name: Setup Pages
43+
uses: actions/configure-pages@v4
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
4846
with:
49-
github_token: ${{ secrets.GITHUB_TOKEN }}
50-
publish_dir: docfx/_site
51-
destination_dir: ${{ steps.branch.outputs.DOCS_LOCATION }}
52-
keep_files: true
53-
full_commit_message: Deploy ${{ steps.branch.outputs.DOCS_LOCATION }} to GitHub Pages
47+
# Upload build docfx site
48+
path: 'docfx/_site'
49+
- name: Deploy to GitHub Pages
50+
id: deployment
51+
uses: actions/deploy-pages@v4

Pipelines/asa-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ resources:
2222
- repository: templates
2323
type: git
2424
name: SecurityEngineering/OSS-Tools-Pipeline-Templates
25-
ref: refs/tags/v1.1.0
25+
ref: refs/tags/v1.1.1
2626

2727
variables:
2828
BuildConfiguration: 'Release'
@@ -37,7 +37,7 @@ stages:
3737
parameters:
3838
jobName: 'dotnet_test_windows'
3939
dotnetVersions: ['6.0.x','7.0.x','8.0.x']
40-
vmImage: 'oss-tools-win2022_1es-managed'
40+
vmImage: 'win2022-image-base'
4141
projectPath: 'Tests/Tests.csproj'
4242

4343
- stage: SDL

Pipelines/asa-release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ resources:
2020
- repository: templates
2121
type: git
2222
name: SecurityEngineering/OSS-Tools-Pipeline-Templates
23-
ref: refs/tags/v1.1.0
23+
ref: refs/tags/v1.1.1
2424

2525
variables:
2626
BuildConfiguration: 'Release'
@@ -35,7 +35,7 @@ stages:
3535
parameters:
3636
jobName: 'dotnet_test_windows'
3737
dotnetVersions: ['6.0.x','7.0.x','8.0.x']
38-
vmImage: 'oss-tools-win2022_1es-managed'
38+
vmImage: 'win2022-image-base'
3939
projectPath: 'Tests/Tests.csproj'
4040

4141
- stage: SDL
@@ -95,7 +95,7 @@ stages:
9595
displayName: Code Sign, Generate Hashes, Publish Public Releases
9696
pool:
9797
name: 'OSS-Tools-1ESPool'
98-
vmImage: 'oss-tools-win2022_1es-managed'
98+
vmImage: 'win2022-image-base'
9999
steps:
100100
- task: UseDotNet@2 # For ESRP. Do not use variable.
101101
inputs:

0 commit comments

Comments
 (0)