Skip to content

Commit

Permalink
Add documentation site (#786)
Browse files Browse the repository at this point in the history
* add docs

* up

* update base

* update

* fix

* update

* fix

* u

* add build test

* up

* don't run e2e for docs

* adapt autogenerated astro readme

* Update README.md
  • Loading branch information
theosanderson authored Jan 18, 2024
1 parent 99bd7fb commit c3ef628
Show file tree
Hide file tree
Showing 20 changed files with 13,909 additions and 2 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/docs-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Docs Build Check

on:
push:
paths:
- 'docs/**'

jobs:
check-docs-build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Install Dependencies
run: npm install
working-directory: ./docs

- name: Check Build
run: npm run build
working-directory: ./docs
39 changes: 39 additions & 0 deletions .github/workflows/docs-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Builds and deploy documentation

on:
workflow_dispatch:
push:
branches:
- main

jobs:
build-and-deploy:
permissions:
contents: write
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20'

- name: Navigate to docs directory
run: cd docs

- name: Install Dependencies
run: npm install
working-directory: ./docs

- name: Build Project
run: npm run build
working-directory: ./docs

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/dist # Adjust if your build output directory is different
5 changes: 5 additions & 0 deletions .github/workflows/e2e-k3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: E2E test (on kubernetes)

on:
push:
paths:
- 'website/**'
- 'backend/**'
- 'kubernetes/**'
- 'preprocessing/**'

concurrency:
group: ci-${{ github.ref }}-e2e-k3d
Expand Down
21 changes: 21 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# build output
dist/
# generated types
.astro/

# dependencies
node_modules/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*


# environment variables
.env
.env.production

# macOS-specific files
.DS_Store
8 changes: 8 additions & 0 deletions docs/.vite/deps/_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"hash": "c1e8de51",
"configHash": "0c82321a",
"lockfileHash": "25f1fc72",
"browserHash": "cf2b5ff5",
"optimized": {},
"chunks": {}
}
3 changes: 3 additions & 0 deletions docs/.vite/deps/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
4 changes: 4 additions & 0 deletions docs/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions docs/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
44 changes: 44 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Docs

This directory is used to build the [Loculus documentation site](https://loculus-project.github.io/loculus/), which is based on [Starlight](https://starlight.astro.build/).

## Project Structure

The directory structure is as follows:

```
.
├── public/
├── src/
│ ├── assets/
│ ├── content/
│ │ ├── docs/
│ │ └── config.ts
│ └── env.d.ts
├── astro.config.mjs
├── package.json
└── tsconfig.json
```

Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name.

Images can be added to `src/assets/` and embedded in Markdown with a relative link.

Static assets, like favicons, can be placed in the `public/` directory.

## Commands

All commands are run from the root of the project, from a terminal:

| Command | Action |
| :------------------------ | :----------------------------------------------- |
| `npm install` | Installs dependencies |
| `npm run dev` | Starts local dev server at `localhost:4321` |
| `npm run build` | Build your production site to `./dist/` |
| `npm run preview` | Preview your build locally, before deploying |
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
| `npm run astro -- --help` | Get help using the Astro CLI |

## More information.

Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build).
32 changes: 32 additions & 0 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";

// https://astro.build/config
export default defineConfig({
base: "/loculus/",
integrations: [
starlight({
title: "Loculus",
editLink: {
baseUrl: "https://github.com/loculus-project/loculus/edit/main/docs/",
},

social: {
github: "https://github.com/loculus-project/loculus",
},
sidebar: [
{
label: "Guides",
items: [
// Each item here is one entry in the navigation menu.
{ label: "Getting started", link: "/guides/getting-started/" },
],
},
{
label: "Reference",
autogenerate: { directory: "reference" },
},
],
}),
],
});
Loading

0 comments on commit c3ef628

Please sign in to comment.