Skip to content

Commit 0359fb6

Browse files
leonardocefcanovai
andauthored
feat: GitHub Pages publishing workflow (#4)
Signed-off-by: Leonardo Cecchi <[email protected]> Signed-off-by: Francesco Canovai <[email protected]> Co-authored-by: Francesco Canovai <[email protected]>
1 parent b003d66 commit 0359fb6

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

.github/workflows/publish-docs.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow builds and deploys the Docusaurus documentation to GitHub Pages
2+
# when changes are pushed to the main branch.
3+
name: Deploy Docusaurus to GitHub Pages
4+
5+
on:
6+
workflow_dispatch:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- 'website/**'
12+
13+
# Prevent parallel deployments when multiple commits are pushed to main
14+
# in a short time.
15+
concurrency:
16+
group: "pages"
17+
cancel-in-progress: false
18+
19+
permissions: read-all
20+
21+
jobs:
22+
build:
23+
runs-on: ubuntu-latest
24+
permissions:
25+
contents: read
26+
pages: read
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v6
30+
31+
- name: Setup Node
32+
uses: actions/setup-node@v6
33+
with:
34+
# Use the latest LTS version of Node.js already installed on the runner.
35+
node-version: latest
36+
check-latest: 'false'
37+
cache: yarn
38+
cache-dependency-path: website/yarn.lock
39+
40+
- name: Setup Pages
41+
uses: actions/configure-pages@v5
42+
43+
- name: Install dependencies
44+
working-directory: website
45+
run: yarn install --frozen-lockfile --non-interactive
46+
47+
- name: Build website
48+
working-directory: website
49+
run: yarn build
50+
51+
- name: Upload artifact
52+
uses: actions/upload-pages-artifact@v4
53+
with:
54+
path: website/build
55+
56+
deploy:
57+
permissions:
58+
pages: write
59+
id-token: write
60+
environment:
61+
name: github-pages
62+
url: ${{ steps.deployment.outputs.page_url }}
63+
needs: build
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

0 commit comments

Comments
 (0)