Skip to content

Commit 0ecc4b7

Browse files
authored
Added devcontainer support (#29)
1 parent 1c47d2b commit 0ecc4b7

File tree

3 files changed

+109
-0
lines changed

3 files changed

+109
-0
lines changed

.devcontainer/devcontainer.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
3+
"customizations": {
4+
"vscode": {
5+
"settings": {
6+
"[typescript]": {
7+
"editor.defaultFormatter": "esbenp.prettier-vscode",
8+
"editor.formatOnSave": true
9+
},
10+
"[json]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode",
12+
"editor.formatOnSave": true
13+
},
14+
"[jsonc]": {
15+
"editor.defaultFormatter": "esbenp.prettier-vscode",
16+
"editor.formatOnSave": true
17+
}
18+
},
19+
"extensions": [
20+
"dbaeumer.vscode-eslint",
21+
"orta.vscode-jest",
22+
"esbenp.prettier-vscode",
23+
"streetsidesoftware.code-spell-checker",
24+
"ms-vscode.remote-explorer",
25+
"usernamehw.errorlens"
26+
]
27+
}
28+
},
29+
"forwardPorts": [
30+
3000
31+
],
32+
"containerUser": "vscode",
33+
"postCreateCommand": "yarn install",
34+
"waitFor": "postCreateCommand", // otherwise automated jest tests fail
35+
"features": {
36+
"node": {
37+
"version": "22"
38+
},
39+
"github-cli": "latest"
40+
}
41+
}

.github/workflows/deploy.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# .github/workflows/deploy.yml -*-yaml-*-
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
name: Deploy to GitHub Pages
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
# Review gh actions docs if you want to further define triggers, paths, etc
11+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
12+
13+
jobs:
14+
build:
15+
name: Build Docusaurus
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version: 18
24+
cache: yarn
25+
26+
- name: Install dependencies
27+
run: yarn install --frozen-lockfile
28+
- name: Build website
29+
run: yarn build
30+
31+
- name: Upload Build Artifact
32+
uses: actions/upload-pages-artifact@v3
33+
with:
34+
path: build
35+
36+
deploy:
37+
name: Deploy to GitHub Pages
38+
needs: build
39+
40+
# TODO: Grant GITHUB_TOKEN the permissions required to make a Pages deployment
41+
permissions:
42+
pages: write # to deploy to Pages
43+
id-token: write # to verify the deployment originates from an appropriate source
44+
45+
# Deploy to the github-pages environment
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
50+
runs-on: ubuntu-latest
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ This website is built using [Docusaurus](https://docusaurus.io/), a modern stati
88
Documentation is written in MDX format.
99
Building and deploying it requires Node and NPM.
1010

11+
## Using the Dev Container
12+
13+
This project includes a development container configuration for VS Code. To use it:
14+
15+
1. Install [Visual Studio Code](https://code.visualstudio.com/) and the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
16+
2. Open the project in VS Code.
17+
3. When prompted, reopen the project in the dev container.
18+
4. The container will automatically install dependencies and set up the environment.
19+
20+
You can then run the following commands inside the container:
21+
22+
- Start the development server: `make start`
23+
- Build the static site: `make build`
24+
1125
## Installation and local development
1226

1327
1. In order to setup the project, you have to install `npm`, `yarn` and `node`.

0 commit comments

Comments
 (0)