Skip to content

Commit 7ac5db3

Browse files
committed
Setup Mike for versioning docs
1 parent 0684a01 commit 7ac5db3

5 files changed

Lines changed: 83 additions & 103 deletions

File tree

.github/workflows/build.yml

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,10 @@ name: Build documentation
22

33
on:
44
push:
5+
tags:
6+
- "*"
57
branches:
6-
- main
7-
8-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
9-
permissions:
10-
contents: read
11-
pages: write
12-
id-token: write
8+
- master
139

1410
# Allow one concurrent deployment
1511
concurrency:
@@ -26,32 +22,23 @@ jobs:
2622
runs-on: ubuntu-latest
2723

2824
steps:
29-
- uses: actions/checkout@v3
25+
- uses: actions/checkout@v4
3026
- name: Set up Python
31-
uses: actions/setup-python@v4
27+
uses: actions/setup-python@v5
3228
with:
3329
python-version: "3.12"
3430
- name: Install dependencies
3531
run: |
3632
python -m pip install --upgrade pip
3733
pip install -r requirements.txt
38-
- name: Set Posthog API key
34+
- name: Parse tag
35+
id: version_tag
36+
uses: battila7/get-version-action@v2
37+
- name: Deploy
38+
env:
39+
DOC_TAG: ${{ steps.version_tag.outputs.major && steps.version_tag.outputs.minor && format('{0}.{1} latest', steps.version_tag.outputs.major, steps.version_tag.outputs.minor) || 'dev' }}
3940
run: |
40-
sed -i 's/__POSTHOG_API_KEY__/${{ secrets.POSTHOG_API_KEY }}/' overrides/partials/integrations/analytics/posthog.html
41-
- name: Build
42-
run: mkdocs build
43-
- name: Upload artifact
44-
uses: actions/upload-pages-artifact@v3
45-
with:
46-
path: ./site
47-
48-
deploy:
49-
environment:
50-
name: github-pages
51-
url: ${{ steps.deployment.outputs.page_url }}
52-
runs-on: ubuntu-latest
53-
needs: build
54-
steps:
55-
- name: Deploy to GitHub Pages
56-
id: deployment
57-
uses: actions/deploy-pages@v4
41+
git config user.name fief-dev-ci
42+
git config user.email ci@fief.dev
43+
git fetch origin gh-pages --depth=1
44+
hatch run mike deploy --push --update-aliases ${{ env.DOC_TAG }}

docs/assets/javascripts/posthog.js

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

mkdocs.yml

Lines changed: 67 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ repo_url: https://github.com/fief-dev/fief
4949
plugins:
5050
- search
5151
- tags
52+
- mike
53+
54+
extra:
55+
version:
56+
provider: mike
5257

5358
markdown_extensions:
5459
- toc:
@@ -78,8 +83,6 @@ markdown_extensions:
7883
- footnotes
7984

8085
extra:
81-
analytics:
82-
provider: posthog
8386
header_links:
8487
- title: About
8588
href: https://www.fief.dev
@@ -95,71 +98,71 @@ extra_javascript:
9598
- assets/javascripts/fernet.js
9699

97100
watch:
98-
- examples
99-
- reusables
100-
- overrides
101+
- examples
102+
- reusables
103+
- overrides
101104

102105
nav:
103106
- index.md
104107
- Stronghold:
105-
- stronghold/index.md
106-
- 'Getting started':
107-
- getting-started/introduction.md
108-
- getting-started/local-instance.md
109-
- getting-started/oauth2.md
110-
- getting-started/try-oauth2.md
108+
- stronghold/index.md
109+
- "Getting started":
110+
- getting-started/introduction.md
111+
- getting-started/local-instance.md
112+
- getting-started/oauth2.md
113+
- getting-started/try-oauth2.md
111114
- user-journey.md
112-
- 'Integrate':
113-
- 'Python':
114-
- 'General': integrate/python/index.md
115-
- integrate/python/fastapi.md
116-
- integrate/python/flask.md
117-
- integrate/python/cli.md
118-
- 'Reference ↗️': https://fief-dev.github.io/fief-python/
119-
- 'JavaScript':
120-
- 'General': integrate/javascript/index.md
121-
- 'Backend':
122-
- integrate/javascript/backend/express.md
123-
- 'SSR':
124-
- integrate/javascript/ssr/nextjs-app.md
125-
- integrate/javascript/ssr/nextjs-pages.md
126-
- 'Frontend':
127-
- integrate/javascript/frontend/browser.md
128-
- integrate/javascript/frontend/react.md
129-
- 'Reference ↗️': https://fief-dev.github.io/fief-js/
130-
- 'Configure':
131-
- configure/index.md
132-
- configure/tenants.md
133-
- configure/clients.md
134-
- configure/oauth-providers.md
135-
- configure/users.md
136-
- configure/user-fields.md
137-
- configure/access-control.md
138-
- configure/webhooks.md
139-
- configure/api-keys.md
140-
- 'Customization':
141-
- configure/customization/themes.md
142-
- configure/customization/email-templates.md
143-
- 'Going further':
144-
- going-further/authorize-url.md
145-
- going-further/acr.md
146-
- going-further/pkce.md
147-
- going-further/id-token-encryption.md
148-
- going-further/oauth-provider-token.md
149-
- 'Admin API':
150-
- api/index.md
151-
- 'Webhooks':
152-
- Integration guide: api/webhooks/guide.md
153-
- Events: api/webhooks/events.md
154-
- 'Self-hosting':
155-
- self-hosting/index.md
156-
- 'Deployment':
157-
- self-hosting/deployment/railway.md
158-
- self-hosting/deployment/render.md
159-
- self-hosting/deployment/docker-compose.md
160-
- 'Configuration':
161-
- self-hosting/configuration/database.md
162-
- self-hosting/configuration/email-provider.md
163-
- self-hosting/configuration/ssl.md
164-
- self-hosting/environment-variables.md
115+
- "Integrate":
116+
- "Python":
117+
- "General": integrate/python/index.md
118+
- integrate/python/fastapi.md
119+
- integrate/python/flask.md
120+
- integrate/python/cli.md
121+
- "Reference ↗️": https://fief-dev.github.io/fief-python/
122+
- "JavaScript":
123+
- "General": integrate/javascript/index.md
124+
- "Backend":
125+
- integrate/javascript/backend/express.md
126+
- "SSR":
127+
- integrate/javascript/ssr/nextjs-app.md
128+
- integrate/javascript/ssr/nextjs-pages.md
129+
- "Frontend":
130+
- integrate/javascript/frontend/browser.md
131+
- integrate/javascript/frontend/react.md
132+
- "Reference ↗️": https://fief-dev.github.io/fief-js/
133+
- "Configure":
134+
- configure/index.md
135+
- configure/tenants.md
136+
- configure/clients.md
137+
- configure/oauth-providers.md
138+
- configure/users.md
139+
- configure/user-fields.md
140+
- configure/access-control.md
141+
- configure/webhooks.md
142+
- configure/api-keys.md
143+
- "Customization":
144+
- configure/customization/themes.md
145+
- configure/customization/email-templates.md
146+
- "Going further":
147+
- going-further/authorize-url.md
148+
- going-further/acr.md
149+
- going-further/pkce.md
150+
- going-further/id-token-encryption.md
151+
- going-further/oauth-provider-token.md
152+
- "Admin API":
153+
- api/index.md
154+
- "Webhooks":
155+
- Integration guide: api/webhooks/guide.md
156+
- Events: api/webhooks/events.md
157+
- "Self-hosting":
158+
- self-hosting/index.md
159+
- "Deployment":
160+
- self-hosting/deployment/railway.md
161+
- self-hosting/deployment/render.md
162+
- self-hosting/deployment/docker-compose.md
163+
- "Configuration":
164+
- self-hosting/configuration/database.md
165+
- self-hosting/configuration/email-provider.md
166+
- self-hosting/configuration/ssl.md
167+
- self-hosting/environment-variables.md
165168
- Telemetry: telemetry.md

overrides/partials/integrations/analytics/posthog.html

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

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
mkdocs-material
2+
mike

0 commit comments

Comments
 (0)