13
13
#
14
14
# -----------------------------------------------------------------------------
15
15
16
- # Simple workflow for deploying static content to GitHub Pages
16
+ # https://xpack-dev-tools.github.io/xpack-dev-tools.github.io/
17
+ # https://github.com/xpack-dev-tools/xpack-dev-tools.github.io/actions/workflows/publish-github-pages.yml
18
+
19
+ # Workflow for deploying static content to GitHub Pages.
17
20
name : GitHub Pages
18
21
22
+ # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
19
23
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows
24
+
20
25
on :
21
26
# Runs on pushes, if all conditions are met:
22
27
push :
36
41
- ' .github/workflows/publish-github-pages.yml'
37
42
- ' package.json'
38
43
39
- # Allows you to run this workflow manually from the Actions tab
44
+ # Allows you to run this workflow manually from the Actions tab.
40
45
workflow_dispatch :
41
46
42
- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
47
+ # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
43
48
permissions :
44
49
contents : read
45
50
pages : write
46
51
id-token : write
47
52
48
- # Allow one concurrent deployment
53
+ # Allow one concurrent deployment.
54
+ # https://docs.github.com/en/actions/using-jobs/using-concurrency
49
55
concurrency :
50
56
group : " pages"
51
57
cancel-in-progress : true
52
58
53
59
jobs :
54
- # Single deploy job since we're just deploying
60
+ # Single deploy job since we're just deploying.
55
61
# https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories
56
62
deploy :
57
63
environment :
58
64
name : github-pages
59
65
url : ${{steps.deployment.outputs.page_url}}
66
+ # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
60
67
runs-on : ubuntu-24.04
61
68
62
69
steps :
@@ -71,26 +78,29 @@ jobs:
71
78
# https://github.com/actions/setup-node
72
79
uses : actions/setup-node@v4
73
80
with :
81
+ # Node LTS version.
74
82
node-version : 20
75
83
76
84
- name : Install dependencies
77
- run : npm ci -C website
85
+ run : (cd website; npm ci)
78
86
79
87
- name : Build the Docusaurus site
80
- run : npm run build -C website
88
+ run : (cd website; npm run build)
81
89
82
90
- name : Setup Pages
83
91
# https://github.com/actions/configure-pages
84
92
uses : actions/configure-pages@v5
85
93
86
- - name : Upload artifact
94
+ - name : Upload Pages artifact
87
95
# https://github.com/actions/upload-pages-artifact
88
96
uses : actions/upload-pages-artifact@v3
89
97
with :
90
98
# Upload entire repository
91
99
path : ' ./website/build'
92
100
93
101
- name : Deploy to GitHub Pages
94
- id : deployment
102
+ id : deployment # referred by environment above, to get the URL.
95
103
# https://github.com/actions/deploy-pages
96
104
uses : actions/deploy-pages@v4
105
+ with :
106
+ artifact_name : github-pages
0 commit comments