Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit cb85601

Browse files
hahuyhoang4110xSagejan-service-account
authored
Update Nitro docs (#127)
* docs: add nitro docus * huge update on Nitro docs * Update github version and stars * Add CICD for nitro docs and enable posthog plugin * disable nitro build for docs/** path * Change support.md --------- Co-authored-by: 0xSage <[email protected]> Co-authored-by: Service Account <[email protected]>
1 parent b92f310 commit cb85601

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+13752
-66
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
branches:
66
- main
77
tags: ['v*.*.*']
8-
paths: ['.github/scripts/**','.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
8+
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '!docs/**', '!.gitignore']
99
pull_request:
1010
types: [opened, synchronize, reopened]
11-
paths: ['.github/scripts/**','.github/workflows/**', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu']
11+
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '!docs/**', '!.gitignore']
1212

1313
env:
1414
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}

.github/workflows/docs.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Nitro Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'docs/**'
9+
pull_request:
10+
branches:
11+
- main
12+
paths:
13+
- 'docs/**'
14+
- '.github/workflows/docs.yml'
15+
# Review gh actions docs if you want to further define triggers, paths, etc
16+
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
17+
18+
jobs:
19+
deploy:
20+
name: Deploy to GitHub Pages
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
28+
- name: Install jq
29+
uses: dcarbone/[email protected]
30+
31+
- name: Fill env vars
32+
run: |
33+
env_example_file=".env.example"
34+
touch .env
35+
while IFS= read -r line || [[ -n "$line" ]]; do
36+
if [[ "$line" == *"="* ]]; then
37+
var_name=$(echo $line | cut -d '=' -f 1)
38+
echo $var_name
39+
var_value="$(jq -r --arg key "$var_name" '.[$key]' <<< "$SECRETS")"
40+
echo "$var_name=$var_value" >> .env
41+
fi
42+
done < "$env_example_file"
43+
working-directory: docs
44+
env:
45+
SECRETS: '${{ toJson(secrets) }}'
46+
47+
- name: Install dependencies
48+
run: yarn install
49+
working-directory: docs
50+
- name: Build website
51+
run: sed -i '/process.env.DEBUG = namespaces;/c\// process.env.DEBUG = namespaces;' ./node_modules/debug/src/node.js && yarn build
52+
working-directory: docs
53+
54+
- name: Add Custome Domain file
55+
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
56+
run: echo "${{ vars.DOCUSAURUS_DOMAIN }}" > ./docs/build/CNAME
57+
58+
# Popular action to deploy to GitHub Pages:
59+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
60+
- name: Deploy to GitHub Pages
61+
if: github.event_name == 'push' && github.event.pull_request.head.repo.full_name != github.repository
62+
uses: peaceiris/actions-gh-pages@v3
63+
with:
64+
github_token: ${{ secrets.GITHUB_TOKEN }}
65+
# Build output to publish to the `gh-pages` branch:
66+
publish_dir: ./docs/build
67+
# The following lines assign commit authorship to the official
68+
# GH-Actions bot for deploys to `gh-pages` branch:
69+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
70+
# The GH actions bot is used by default if you didn't specify the two fields.
71+
# You can swap them out with your own user credentials.
72+
user_name: github-actions[bot]
73+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
*.pdb
4949

5050
# Kernel Module Compile Results
51-
*.mod*
51+
*.mod
5252
*.cmd
5353
.tmp_versions/
5454
modules.order

docs/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
POSTHOG_PROJECT_API_KEY=xxxx
2+
POSTHOG_APP_URL=xxxx

docs/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Dependencies
2+
/node_modules
3+
4+
# Production
5+
/build
6+
7+
# Generated files
8+
.docusaurus
9+
.cache-loader
10+
11+
# Misc
12+
.DS_Store
13+
.env.local
14+
.env.development.local
15+
.env.test.local
16+
.env.production.local
17+
18+
npm-debug.log*
19+
yarn-debug.log*
20+
yarn-error.log*
21+
.env

docs/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Website
2+
3+
This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator.
4+
5+
### Installation
6+
7+
```
8+
$ yarn
9+
```
10+
11+
### Local Development
12+
13+
```
14+
$ yarn start
15+
```
16+
17+
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
18+
19+
### Build
20+
21+
```
22+
$ yarn build
23+
```
24+
25+
This command generates static content into the `build` directory and can be served using any static contents hosting service.
26+
27+
### Deployment
28+
29+
Using SSH:
30+
31+
```
32+
$ USE_SSH=true yarn deploy
33+
```
34+
35+
Not using SSH:
36+
37+
```
38+
$ GIT_USER=<Your GitHub username> yarn deploy
39+
```
40+
41+
If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
42+
43+
### Additional Plugins
44+
- @docusaurus/theme-live-codeblock
45+
- [Redocusaurus](https://redocusaurus.vercel.app/): manually upload swagger files at `/openapi/OpenAPISpec.json`

docs/babel.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
3+
};

docs/blog/authors.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
dan-jan:
2+
name: Daniel Onggunhao
3+
title: Co-Founder
4+
url: https://github.com/dan-jan
5+
image_url: https://avatars.githubusercontent.com/u/101145494?v=4
6+

docs/blog/hello-world.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
title: Hello World
3+
description: This is my first post on Docusaurus.
4+
slug: hello-world
5+
authors:
6+
- name: Daniel
7+
tags: [hello, jan]
8+
image: https://i.imgur.com/mErPwqL.png
9+
hide_table_of_contents: false
10+
---
11+
12+
Hello World!

docs/blog/test.md

Whitespace-only changes.

0 commit comments

Comments
 (0)