Skip to content

Commit e0ef492

Browse files
committed
update mkdocs workflow to work on PR to devel
ensure the GitHub token is used when pushing by setting credentials before mkdocs gh-deploy
1 parent 11f7884 commit e0ef492

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

.github/workflows/build-mkdocs-website.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,21 @@ on:
1010
- 'docs/**/**'
1111
- 'mkdocs.yml'
1212

13-
permissions:
14-
contents: write
15-
1613
jobs:
1714
build-and-deploy:
1815
if: |
1916
github.event_name == 'workflow_dispatch' ||
2017
(github.event_name == 'pull_request' && github.event.pull_request.merged == true)
2118
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
2221

2322
steps:
2423
- name: Checkout repository
25-
uses: actions/checkout@v3
24+
uses: actions/checkout@v4
2625

2726
- name: Set up Python
28-
uses: actions/setup-python@v2
27+
uses: actions/setup-python@v5
2928
with:
3029
python-version: 3.x
3130

@@ -36,8 +35,9 @@ jobs:
3635
run: mkdocs build
3736

3837
- name: Deploy to GitHub Pages
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3940
run: |
41+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}
4042
mkdocs gh-deploy --force
4143
git push origin gh-pages
42-
env:
43-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)