Skip to content

Commit c33f749

Browse files
ikreymerShrinks99
andauthored
Frontend hosted-docs (#2107)
Fixes #2106 Docs are now hosted as part of the frontend at `/docs` by default. - If `docs_url` is set in the helm chart, the `/docs` endpoint will redirect to that endpoint instead - Use multi-stage python image to build mkdocs as part of frontend, then copy static output - Dir layout: mkdocs.yml and docs into frontend/docs - CI: Update docs build GH action to use new path - Update all frontend paths to use `/docs/` instead of `https://docs.browsertrix.com/` --------- Co-authored-by: Henry Wilkinson <henry@wilkinson.graphics>
1 parent d12ce9a commit c33f749

File tree

86 files changed

+283
-237
lines changed

Some content is hidden

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

86 files changed

+283
-237
lines changed

.github/workflows/docs-publish.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ jobs:
1919
- run: pip install mkdocs-material requests pyyaml
2020

2121
- name: Generate Helm Chart Index
22-
run: python ./scripts/generate-helm-index.py > ./docs/helm-repo/index.yaml
22+
run: python ./scripts/generate-helm-index.py > ./frontend/docs/docs/helm-repo/index.yaml
2323

24-
- run: mkdocs gh-deploy --force
24+
- run: cd frontend/docs; mkdocs gh-deploy --force

chart/templates/frontend.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ spec:
4949
- name: RWP_BASE_URL
5050
value: {{ .Values.rwp_base_url }}
5151

52+
{{- if .Values.docs_url }}
53+
- name: DOCS_URL
54+
value: {{ .Values.docs_url }}
55+
{{- end }}
56+
5257
{{- if .Values.minio_local }}
5358
- name: LOCAL_MINIO_HOST
5459
value: "{{ .Values.minio_host }}"

chart/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ local_service_port: 30870
156156

157157
frontend_alias: "http://browsertrix-cloud-frontend"
158158

159+
# custom URL for where Browsertrix docs are hosted
160+
# by default, docs are served from /docs/ but can be served from a custom
161+
# URL specified here.
162+
# docs_url: "https://browsertrix-docs.example.com/"
163+
159164
# Autoscaling
160165
# -----------
161166
# max number of backend pods to scale to

docs/overrides/main.html

Lines changed: 0 additions & 6 deletions
This file was deleted.

docs/stylesheets/extra.css

Lines changed: 0 additions & 188 deletions
This file was deleted.

frontend/.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ module.exports = {
138138
typescript: true,
139139
},
140140
},
141-
ignorePatterns: ["__generated__", "__mocks__", "dist"],
141+
ignorePatterns: ["__generated__", "__mocks__", "dist", "docs"],
142142
overrides: [
143143
{
144144
extends: ["plugin:@typescript-eslint/disable-type-checked"],

frontend/.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ __generated__
22
__mocks__
33
assets
44
dist
5+
docs

frontend/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,23 @@ ENV GIT_COMMIT_HASH=${GIT_COMMIT_HASH} \
3535
RUN yarn build && \
3636
rm -rf ./node_modules
3737

38+
FROM --platform=$BUILDPLATFORM docker.io/library/python:3.12-slim as build_docs
39+
40+
WORKDIR /docs
41+
42+
RUN pip install mkdocs-material
43+
44+
COPY --link ./docs/mkdocs.yml .
45+
COPY --link ./docs/docs ./docs
46+
47+
RUN mkdocs build
48+
3849
FROM docker.io/library/nginx:1.23.2
3950

4051
COPY --link --from=build_deps /app/dist /usr/share/nginx/html
4152

53+
COPY --link --from=build_docs /docs/site /usr/share/nginx/html/docs
54+
4255
#COPY ./nginx.conf /etc/nginx/nginx.conf
4356
COPY --link ./frontend.conf.template /etc/nginx/templates/
4457
COPY --link ./minio.conf /etc/nginx/includes/

frontend/docs/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
site
File renamed without changes.

0 commit comments

Comments
 (0)