feat: build versioned documentation site form CI pipeline

This commit is contained in:
Thomas Dupont 2022-06-16 15:33:49 +02:00 committed by Joachim Van Herwegen
parent 9ecb769e09
commit 027c803b33
16 changed files with 136 additions and 8 deletions

View File

@ -251,7 +251,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
docs: typedocs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
@ -259,7 +259,7 @@ jobs:
with: with:
node-version: '16.x' node-version: '16.x'
- run: npm ci --ignore-scripts - run: npm ci --ignore-scripts
- run: npm run docs - run: npm run typedocs
- name: Save docs - name: Save docs
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
@ -267,9 +267,28 @@ jobs:
path: docs path: docs
retention-days: 1 retention-days: 1
mkdocs:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
needs:
- typedocs
steps:
- uses: actions/checkout@v2
- id: get_version
uses: battila7/get-version-action@v2
- uses: actions/setup-python@v2
with:
python-version: 3.x
- run: pip install mkdocs-material
- run: pip install mike
- run: git config user.name ci-bot
- run: git config user.email ci-bot@example.com
- run: git fetch origin gh-pages --depth=1
- run: cd documentation && mike deploy --push --update-aliases ${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}} latest
publish-docs: publish-docs:
needs: needs:
- docs - mkdocs
- lint - lint
- test-unit - test-unit
- test-integration - test-integration
@ -282,7 +301,10 @@ jobs:
with: with:
name: docs name: docs
path: docs path: docs
- id: get_version
uses: battila7/get-version-action@v2
- uses: peaceiris/actions-gh-pages@v3 - uses: peaceiris/actions-gh-pages@v3
with: with:
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: . publish_dir: ./docs
destination_dir: ${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}}/docs

View File

@ -1,4 +1,9 @@
# Documentation ---
hide:
- navigation
---
# Welcome
Welcome to the Community Solid Server! Welcome to the Community Solid Server!
Here we will cover many aspects of the server, Here we will cover many aspects of the server,

View File

@ -69,5 +69,5 @@ The `ErrorHandler` will convert the error to an HTTP response to be returned.
Below are sections that go deeper into the specific steps. Below are sections that go deeper into the specific steps.
Not all steps are covered yet and will be added in the future. Not all steps are covered yet and will be added in the future.
[How authentication and authorization work](authorization.md) * [How authentication and authorization work](authorization.md)
[What the `ResourceStore` looks like](resource-store.md) * [What the `ResourceStore` looks like](resource-store.md)

89
documentation/mkdocs.yml Normal file
View File

@ -0,0 +1,89 @@
docs_dir: markdown
theme:
name: 'material'
custom_dir: overrides
icon:
repo: fontawesome/brands/github
palette:
- media: "(prefers-color-scheme: light)"
scheme: default
toggle:
icon: material/weather-night
name: Switch to dark mode
primary: deep purple
accent: deep orange
# Palette toggle for dark mode
- media: "(prefers-color-scheme: dark)"
scheme: slate
toggle:
icon: material/weather-sunny
name: Switch to light mode
primary: deep purple
accent: deep orange
features:
- navigation.instant
- navigation.tabs
- navigation.top
- navigation.indexes
site_name: 'Community Solid Server'
site_url: https://communitysolidserver.github.io/CommunitySolidServer
repo_url: https://github.com/CommunitySolidServer/CommunitySolidServer
repo_name: CommunitySolidServer
edit_uri: ""
plugins:
- search
markdown_extensions:
- admonition
- def_list
- footnotes
- meta
- tables
- toc:
permalink: true
- pymdownx.betterem:
smart_enable: all
- pymdownx.caret
- pymdownx.tilde
- pymdownx.details
- pymdownx.highlight
- pymdownx.superfences
- pymdownx.smartsymbols
extra:
version:
provider: mike
social:
- icon: fontawesome/brands/github
link: https://github.com/CommunitySolidServer/CommunitySolidServer
- icon: fontawesome/brands/docker
link: https://hub.docker.com/r/solidproject/community-server
- icon: fontawesome/brands/npm
link: https://www.npmjs.com/package/@solid/community-server
- icon: fontawesome/brands/gitter
link: https://gitter.im/CommunitySolidServer/community
nav:
- Welcome:
- README.md
- Usage:
- 'Example request': example-requests.md
- 'Identity provider': identity-provider.md
- 'Client credentials': client-credentials.md
- 'Seeding Pods': seeding-pods.md
- Architecture:
- Architecture: architecture.md
- Dependency injection: dependency-injection.md
- Contributing:
- Pull requests: making-changes.md
- Releases: release.md
- API: ./docs/" target="_blank
# To write documentation locally, execute the next line and browse to http://localhost:8000
# docker run --rm -it -p 8000:8000 -v ${PWD}/documentation:/docs squidfunk/mkdocs-material

View File

@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block outdated %}
You're not viewing the latest version.
<a href="{{ '../' ~ base_url }}">
<strong>Click here to go to latest.</strong>
</a>
{% endblock %}

View File

@ -0,0 +1,4 @@
.tsd-page-toolbar,
.tsd-page-title {
background-color: #7E56C2;
}

View File

@ -50,7 +50,7 @@
"docker:setup": "./test/docker/docker-setup.sh", "docker:setup": "./test/docker/docker-setup.sh",
"docker:start": "./test/docker/docker-start.sh", "docker:start": "./test/docker/docker-start.sh",
"docker:stop": "./test/docker/docker-stop.sh", "docker:stop": "./test/docker/docker-stop.sh",
"docs": "typedoc", "typedocs": "typedoc --customCss ./documentation/typedoc.css",
"jest": "jest --coverageReporters text-summary --", "jest": "jest --coverageReporters text-summary --",
"lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0", "lint": "eslint . --cache --ignore-path .gitignore --max-warnings 0",
"prepare": "npm run build", "prepare": "npm run build",