Skip to content

Commit 9733b5f

Browse files
authored
Updated pages deployment (Azure#2817)
1 parent 07ee05d commit 9733b5f

File tree

1 file changed

+47
-7
lines changed

1 file changed

+47
-7
lines changed

.github/workflows/docs.yaml

+47-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ name: Docs
99
on:
1010
push:
1111
branches:
12-
- main
12+
- main
1313
workflow_dispatch:
1414

1515
permissions: {}
@@ -19,13 +19,12 @@ env:
1919
DOTNET_CLI_TELEMETRY_OPTOUT: true
2020

2121
jobs:
22-
deploy:
22+
publish:
2323
name: Publish docs
2424
runs-on: ubuntu-latest
2525
permissions:
2626
contents: write
2727
steps:
28-
2928
- name: Checkout
3029
uses: actions/checkout@v4
3130
with:
@@ -54,13 +53,54 @@ jobs:
5453
Invoke-Build BuildDocs
5554
shell: pwsh
5655

56+
- name: Checkout gh-pages
57+
uses: actions/checkout@v4
58+
with:
59+
ref: refs/heads/gh-pages
60+
path: site/
61+
5762
- name: Build site
5863
run: mkdocs build
5964
env:
6065
MKDOCS_GIT_COMMITTERS_APIKEY: ${{ secrets.GITHUB_TOKEN }}
6166

62-
- name: Deploy
63-
uses: peaceiris/actions-gh-pages@v3
67+
- name: Push content
68+
run: |
69+
cd site/
70+
git config user.name github-actions
71+
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
72+
git add *
73+
git commit -m "deploy ${{ github.sha }}"
74+
git push
75+
76+
deploy:
77+
name: Deploy pages
78+
environment:
79+
name: github-pages
80+
url: ${{ steps.deployment.outputs.page_url }}
81+
runs-on: ubuntu-latest
82+
needs: [publish]
83+
concurrency:
84+
group: pages
85+
cancel-in-progress: false
86+
permissions:
87+
contents: read
88+
pages: write
89+
id-token: write
90+
steps:
91+
- name: Checkout
92+
uses: actions/checkout@v4
6493
with:
65-
github_token: ${{ secrets.GITHUB_TOKEN }}
66-
publish_dir: ./site
94+
ref: refs/heads/gh-pages
95+
96+
- name: Setup Pages
97+
uses: actions/configure-pages@v5
98+
99+
- name: Upload artifact
100+
uses: actions/upload-pages-artifact@v3
101+
with:
102+
path: '.'
103+
104+
- name: Deploy to GitHub Pages
105+
id: deployment
106+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)