Skip to content

Commit

Permalink
Setup docusaurs website
Browse files Browse the repository at this point in the history
  • Loading branch information
wkozyra95 committed Nov 24, 2023
1 parent f1d0e97 commit 5a59608
Show file tree
Hide file tree
Showing 31 changed files with 29,710 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: deploy to gh-pages

on:
workflow_dispatch: {}
push:
branches: [master]
paths:
- "docs/**"
- "schemas/**"

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
deploy:
name: Deploy to GitHub Pages
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: 📥 Checkout repo
uses: actions/checkout@v3

- name: 🛠 Setup Node.JS
uses: actions/setup-node@v3

- name: 🛠 Install dependencies
run: yarn ci

- name: 📦 Build website
run: yarn build

- name: 🖋️ Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# Build output to publish to the `gh-pages` branch:
publish_dir: ./build
# The following lines assign commit authorship to the official
# GH-Actions bot for deploys to `gh-pages` branch:
user_name: github-actions[bot]
user_email: 41898282+github-actions[bot]@users.noreply.github.com
35 changes: 35 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: website build and lint
on:
push:
branches: [master]
paths:
- "docs/**"
- "schemas/**"
pull_request:
types: [opened, synchronize]
paths:
- "docs/**"
- "schemas/**"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}

jobs:
node:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- name: 🛠 Setup Node.JS
uses: actions/setup-node@v3

- name: 📥 Checkout repo
uses: actions/checkout@v3

- name: 🛠 Install dependencies
run: npm ci

- name: 🖋️ Run lint
run: npm run typecheck && npm run lint --max-warnings=0 && npm run build
40 changes: 40 additions & 0 deletions docs/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"env": {
"browser": true,
"commonjs": true
},
"extends": [
"eslint:recommended",
"plugin:@docusaurus/recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/recommended",
"plugin:import/typescript",
"prettier"
],
"plugins": [
"prettier"
],
"parser": "@typescript-eslint/parser",
"rules": {
"prettier/prettier": [
"error"
],
"@typescript-eslint/no-explicit-any": [
0
],
"no-constant-condition": [
0
],
"import/no-unresolved": [
2,
{
"ignore": [
"^@theme",
"^@docusaurus",
"^@site"
]
}
]
}
}
1 change: 1 addition & 0 deletions docs/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock.json linguist-generated
20 changes: 20 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
9 changes: 9 additions & 0 deletions docs/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": true,
"bracketSameLine": true,
"trailingComma": "es5",
"arrowParens": "avoid",
"endOfLine": "auto"
}
21 changes: 21 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Documentation website

### Installation

```bash
npm install
```

### Local Development

```bash
npm run start
```

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

### Deployment

```bash
USE_SSH=true npm run deploy
```
3 changes: 3 additions & 0 deletions docs/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: [require.resolve('@docusaurus/core/lib/babel/preset')],
};
104 changes: 104 additions & 0 deletions docs/docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
import { themes as prismThemes } from 'prism-react-renderer';
import type { Config } from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';

const config: Config = {
title: 'Live Compositor',
favicon: 'img/favicon.ico',

// Set the production url of your site here
url: 'https://compositor.live',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: '/',

// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'membraneframework', // Usually your GitHub org/user name.
projectName: 'video_compositor', // Usually your repo name.

onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',

// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
path: 'pages',
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],

themeConfig: {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: {
title: 'Live Compositor',
logo: {
alt: 'compositor logo',
src: 'img/logo.svg',
},
items: [
{
href: 'https://github.com/facebook/docusaurus',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'Introduction',
items: [
{
label: 'Tutorial',
to: '/docs/intro',
},
],
},
{
title: 'Community',
items: [
{
label: 'Twitter',
href: 'https://twitter.com/docusaurus',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/membraneframework/video_compositor',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} Software Mansion S.A.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
} satisfies Preset.ThemeConfig,
};

export default config;
Loading

0 comments on commit 5a59608

Please sign in to comment.