Skip to content

Commit ff11315

Browse files
authored
Add release workflow (#222)
1 parent 0fee166 commit ff11315

5 files changed

Lines changed: 15418 additions & 2574 deletions

File tree

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release website
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
workflow_dispatch:
8+
push:
9+
branches: [main]
10+
paths:
11+
- 'website/**'
12+
13+
concurrency:
14+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
15+
cancel-in-progress: true
16+
17+
defaults:
18+
run:
19+
shell: bash
20+
working-directory: ./website
21+
22+
jobs:
23+
build:
24+
name: Build Docusaurus
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v5
28+
with:
29+
fetch-depth: 0
30+
- uses: actions/setup-node@v6
31+
with:
32+
node-version: 24
33+
cache: 'npm'
34+
cache-dependency-path: './website/package-lock.json'
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
- name: Build website
39+
run: npm run build
40+
41+
- name: Upload Build Artifact
42+
uses: actions/upload-pages-artifact@v4
43+
with:
44+
path: build
45+
46+
deploy:
47+
name: Deploy to GitHub Pages
48+
needs: build
49+
50+
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
51+
permissions:
52+
pages: write # to deploy to Pages
53+
id-token: write # to verify the deployment originates from an appropriate source
54+
55+
# Deploy to the github-pages environment
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
60+
runs-on: ubuntu-latest
61+
steps:
62+
- name: Deploy to GitHub Pages
63+
id: deployment
64+
uses: actions/deploy-pages@v4

.github/workflows/website.yml

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,29 @@ concurrency:
1313
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
1414
cancel-in-progress: true
1515

16+
defaults:
17+
run:
18+
shell: bash
19+
working-directory: ./website
20+
1621
jobs:
1722
website-docs:
1823
runs-on: ubuntu-latest
1924
steps:
2025
- name: Checkout repository
2126
uses: actions/checkout@v5
2227

23-
- name: Setup Bun
24-
uses: oven-sh/setup-bun@v2
25-
26-
- name: Get Bun cache directory
27-
id: bun-cache-dir
28-
run: echo "dir=$(bun pm cache)" >> ${GITHUB_OUTPUT}
29-
30-
- name: Cache Bun dependencies
31-
uses: actions/cache@v4
28+
- uses: actions/setup-node@v6
3229
with:
33-
path: |
34-
${{ steps.bun-cache-dir.outputs.dir }}
35-
~/.bun/install/cache
36-
key: ${{ runner.os }}-bun-lint-${{ hashFiles('**/bun.lockb', '**/package.json', '**/bun.lock') }}
37-
restore-keys: |
38-
${{ runner.os }}-bun-lint-
39-
${{ runner.os }}-bun-
30+
node-version: 24
31+
cache: 'npm'
32+
cache-dependency-path: './website/package-lock.json'
4033

41-
- name: Install website dependencies
42-
run: cd website && bun install --frozen-lockfile
34+
- name: Install dependencies
35+
run: npm ci
4336

4437
- name: Check MDX
45-
run: cd website && bun linter
38+
run: npm run linter
4639

4740
- name: Build website
48-
run: cd website && bun run build
41+
run: npm run build

website/README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,31 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
55
## Installation
66

77
```bash
8-
bun install
8+
npm install
99
```
1010

1111
## Local Development
1212

1313
```bash
14-
bun start
14+
npm run start
1515
```
1616

1717
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
1818

1919
## Build
2020

2121
```bash
22-
bun run build
22+
npm run build
2323
```
2424

2525
This command generates static content into the `build` directory and can be served using any static contents hosting service.
2626

2727
## Deployment
2828

29+
There is a GitHub action deploying automatically the website when pushing changes to the website folder on main.
30+
2931
```bash
30-
USE_SSH=true bun run deploy
32+
USE_SSH=true npm run deploy
3133
```
3234

3335
We are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.

0 commit comments

Comments
 (0)