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

Chore: Rework documentation layout using mkdocs #86

Merged
merged 3 commits into from
Oct 18, 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
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2
updates:
- package-ecosystem: pip
# We only want to bump versions of packages in case of security updates, as
# we want to keep maximum compatibility - see https://t.ly/INSR_
open-pull-requests-limit: 0
directory: "/"
labels: []
schedule:
interval: weekly
time: "08:00"
- package-ecosystem: github-actions
open-pull-requests-limit: 10
directory: "/"
labels: []
schedule:
interval: weekly
time: "08:00"
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: tests
on:
pull_request:
branches:
- main

env:
PYTHON_VERSION: 3.x

jobs:
build:
name: Build documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: |
requirements.txt

- name: Install dependencies
run: make init

- name: Build documentation with strict mode
run: make test
68 changes: 68 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: documentation
on:
push:
branches:
- main

env:
PYTHON_VERSION: 3.x

permissions:
contents: write
id-token: write
pages: write

jobs:
documentation:
name: Build documentation
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: pip
cache-dependency-path: |
requirements.txt

- name: Install dependencies
run: make init

- name: Build documentation
run: make build

- name: Configure AWS Credentials if S3 deploying is enabled
# Giving this step a name so we can check later if we need to deploy to GitHub Pages instead.
id: using-s3
if: ${{ env.AWS_ACCESS_KEY_ID && env.AWS_SECRET_ACCESS_KEY && env.AWS_S3_BUCKET && env.AWS_REGION }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}

- name: Push to S3 if enabled
if: ${{ steps.using-s3.conclusion == 'success' }}
run: aws s3 sync ./site/ s3://${{ secrets.AWS_S3_BUCKET }} --delete
env:
AWS_REGION: ${{ secrets.AWS_REGION }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}

- name: Prepare GitHub Pages artifact if not deploying to S3
if: ${{ steps.using-s3.conclusion == 'skipped' }}
uses: actions/upload-pages-artifact@v3
with:
path: site

- name: Deploy to GitHub Pages
if: ${{ steps.using-s3.conclusion == 'skipped' }}
continue-on-error: true
uses: actions/deploy-pages@v4
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.venv
__pycache__
.env
.venv/
/site/
/.cache/
steven-noorbergen marked this conversation as resolved.
Show resolved Hide resolved
/.idea/
8 changes: 8 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"GitHub.copilot",
"bierner.markdown-mermaid",
"esbenp.prettier-vscode",
"redhat.vscode-yaml"
]
}
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Local development",
"type": "debugpy",
"request": "launch",
"program": "${workspaceRoot}/.venv/bin/mkdocs",
"args": ["serve"],
"serverReadyAction": {
"pattern": "Serving on (https?://.+)",
"uriFormat": "%s",
"action": "openExternally"
}
}
]
}
57 changes: 57 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{
"editor.tabSize": 4,
"editor.formatOnSave": true,
"editor.inlineSuggest.enabled": true,
"typescript.validate.enable": true,
"javascript.validate.enable": true,
"[json]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsonc]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[css]": {
"editor.tabSize": 2
},
"[scss]": {
"editor.tabSize": 2
},
"[javascript]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.tabSize": 2,
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.tabSize": 2
},
"[markdown]": {
"editor.tabSize": 4
},
"[yaml]": {
"editor.tabSize": 2
},
"[github-actions-workflow]": {
"editor.tabSize": 2
},
// Tabs should be spaces.
steven-noorbergen marked this conversation as resolved.
Show resolved Hide resolved
"editor.insertSpaces": true,
"workbench.colorCustomizations": {
"titleBar.activeForeground": "#000000",
"titleBar.inactiveForeground": "#cccccc",
"titleBar.activeBackground": "#ff9925",
"titleBar.inactiveBackground": "#341f00"
}
}
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: init serve
SHELL := /bin/bash

init:
python3 -m venv .venv
source .venv/bin/activate && pip install -r requirements.txt

serve:
source .venv/bin/activate && mkdocs serve

build:
source .venv/bin/activate && mkdocs build --clean

test:
source .venv/bin/activate && mkdocs build --strict --clean
Loading