Skip to content

Commit 3fd36e2

Browse files
authored
Modernize GitHub Pages deploy workflow (#1063)
And add `workflow_dispatch` trigger to allow manual deployment
1 parent 0359b93 commit 3fd36e2

File tree

1 file changed

+21
-11
lines changed

1 file changed

+21
-11
lines changed

.github/workflows/docs.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
- develop
88
release:
99
types: [released]
10+
workflow_dispatch:
1011

1112
jobs:
12-
docs:
13-
name: Docs Deployment
13+
build:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v5
@@ -22,13 +22,23 @@ jobs:
2222
run: npm ci
2323
- name: Generate docs
2424
run: npm run doc
25-
- name: Deploy
26-
uses: peaceiris/actions-gh-pages@v4
27-
if: github.event_name == 'release'
25+
- name: Upload static files as artifact
26+
id: deployment
27+
uses: actions/upload-pages-artifact@v3
2828
with:
29-
github_token: ${{ secrets.RWT_BOT_PAT }}
30-
publish_dir: docs
31-
destination_dir: .
32-
enable_jekyll: false
33-
force_orphan: false # So we keep the doc history
34-
commit_message: Typedoc ${{ github.event.release.name }}
29+
path: docs/
30+
31+
deploy:
32+
needs: build
33+
runs-on: ubuntu-latest
34+
environment:
35+
name: github-pages
36+
url: ${{ steps.deployment.outputs.page_url }}
37+
permissions:
38+
actions: read # to read the artifact from the previous job
39+
pages: write
40+
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
41+
steps:
42+
- name: Deploy to GitHub Pages
43+
id: deployment
44+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)