Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move docsite to main repo #1204

Merged
merged 13 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "docs/"
schedule:
interval: "weekly"
day: "friday"
time: "09:00"
timezone: "America/Los_Angeles"
groups:
docsite-dev-dependencies:
dependency-type: "development"
exclude-patterns:
- "*docusaurus*"
docsite-docusaurus:
patterns:
- "*docusaurus*"
docsite-prod-dependencies:
dependency-type: "production"
exclude-patterns:
- "*docusaurus*"
- package-ecosystem: "npm"
directory: "/"
schedule:
Expand Down
36 changes: 26 additions & 10 deletions .github/workflows/build-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,28 @@ env:
NODE_VERSION: "20"
STATIC_DOCSITE_PATH: docsite
jobs:
runbuild:
permissions:
contents: write
build-docsite:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Install Yarn
run: |
corepack enable
yarn install
working-directory: docs/
- name: Build embedded docsite
run: yarn build-embedded
working-directory: docs/
- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: docsite
path: docs/build
build-app:
needs: build-docsite
outputs:
version: ${{ steps.set-version.outputs.WAVETERM_VERSION }}
strategy:
Expand Down Expand Up @@ -109,13 +128,10 @@ jobs:
smctl windows certsync
shell: cmd

- name: Download waveterm-docs static site
uses: dawidd6/action-download-artifact@v6
- name: Download embedded docsite
uses: actions/download-artifact@v4
with:
github_token: ${{secrets.GITHUB_TOKEN}}
workflow: build-embedded.yml
repo: wavetermdev/waveterm-docs
name: static-site
name: docsite
path: ${{env.STATIC_DOCSITE_PATH}}

# Build and upload packages
Expand Down Expand Up @@ -162,7 +178,7 @@ jobs:
path: make
create-release:
runs-on: ubuntu-latest
needs: runbuild
needs: build-app
permissions:
contents: write
if: ${{ github.event_name != 'workflow_dispatch' }}
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/deploy-docsite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Deploy Docsite and Storybook

env:
NODE_VERSION: 20

on:
push:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
workflow_dispatch:

jobs:
build:
name: Build Docsite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Install yarn
run: |
corepack enable
yarn install
- name: Build docsite
run: yarn build
working-directory: docs/

- name: Build Storybook
run: yarn build-storybook
working-directory: storybook/
- name: Copy Storybook to docs
run: cp -r storybook-static docs/build/storybook
- name: Upload Build Artifact
uses: actions/upload-pages-artifact@v3
with:
path: docs/build
deploy:
name: Deploy to GitHub Pages
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source

# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}

runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
42 changes: 0 additions & 42 deletions .github/workflows/deploy-storybook.yml

This file was deleted.

36 changes: 36 additions & 0 deletions .github/workflows/test-build-docsite.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Test Docsite and Storybook Build

env:
NODE_VERSION: 20

on:
pull_request:
branches:
- main
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on
paths:
- "docs/**"
- "storybook/**"
- "**/*.story.*"
- "**/*.stories.*"
jobs:
test-deploy:
name: Test deployment
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: ${{env.NODE_VERSION}}
- name: Install yarn
run: |
corepack enable
yarn install
- name: Test build website
run: yarn build
working-directory: docs/
- name: Test build storybook
run: yarn build-storybook
4 changes: 2 additions & 2 deletions .storybook/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { create } from "@storybook/theming";
export const light = create({
base: "light",
brandTitle: "Wave Terminal Storybook",
brandUrl: "https://storybook.waveterm.dev",
brandUrl: "https://docs.waveterm.dev/storybook/",
brandImage: "/assets/wave-light.png",
brandTarget: "_self",
});

export const dark = create({
base: "dark",
brandTitle: "Wave Terminal Storybook",
brandUrl: "https://storybook.waveterm.dev",
brandUrl: "https://docs.waveterm.dev/storybook/",
brandImage: "/assets/wave-dark.png",
brandTarget: "_self",
});
2 changes: 1 addition & 1 deletion CNAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
storybook.waveterm.dev
docs.waveterm.dev
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We welcome and value contributions to Wave Terminal! Wave is an open source proj

- Submit issues related to bugs or new feature requests
- Fix outstanding [issues](https://github.com/wavetermdev/waveterm/issues) with the existing code
- Contribute to [documentation](https://github.com/wavetermdev/waveterm-docs)
- Contribute to [documentation](./docs)
- Spread the word on social media (tag us on [LinkedIn](https://www.linkedin.com/company/wavetermdev), [Twitter/X](https://x.com/wavetermdev))
- Or simply ⭐️ the repository to show your appreciation

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Find more information in our [Contributions Guide](CONTRIBUTING.md), which inclu

- [Ways to contribute](CONTRIBUTING.md#contributing-to-wave-terminal)
- [Contribution guidelines](CONTRIBUTING.md#before-you-start)
- [Storybook](https://storybook.waveterm.dev)
- [Storybook](https://docs.waveterm.dev/storybook)

### Activity

Expand Down
13 changes: 13 additions & 0 deletions docs/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true

[*.{js,jsx,ts,tsx,cjs,json,yml,yaml,css,less}]
charset = utf-8
indent_style = space
indent_size = 4

[CNAME]
insert_final_newline = false
22 changes: 22 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Dependencies
/node_modules
/.yarn

# Production
/build
build.zip

# 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*
6 changes: 6 additions & 0 deletions docs/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
build
.git
node_modules
*.min.*
*.mdx
CNAME
8 changes: 8 additions & 0 deletions docs/.remarkrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"plugins": [
"remark-preset-lint-consistent",
"remark-preset-lint-recommended",
"remark-mdx",
"remark-frontmatter"
]
}
1 change: 1 addition & 0 deletions docs/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
40 changes: 40 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="./assets/wave-dark.png">
<source media="(prefers-color-scheme: light)" srcset="./assets/wave-light.png">
<img alt="Wave Terminal Logo" src="./assets/wave-light.png" width="240">
</picture>
<br/>
</p>

# Wave Terminal Documentation

This is the home for Wave Terminal's documentation site. This README is specifically about _building_ and contributing to the docs site. If you are looking for the actual hosted docs, go here -- https://docs.waveterm.dev

### Installation

Our docs are built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

```sh
yarn
```

### Local Development

```sh
yarn 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.

### Build

```sh
yarn build
```

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

### Deployment

Deployments are handled automatically by the [Deploy action](.github/workflows/deploy.yml)
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")],
};
Loading
Loading