Fix/local development (#101)

* **Remove Python SCSS compiler and development script**

- Deleted `compile_scss.py` and `dev.sh` scripts to clean up unused SCSS compilation and local development workflow.
- Streamlining project by removing legacy Python-based tooling. Clear shift toward alternative CSS build processes in workflows.

* Migrate SCSS compilation to Python-based workflow and simplify Dockerfile

- Replaced Node.js SCSS tools with libsass and introduced `scss_watcher.py` for automated SCSS compilation during development.
- Updated Dockerfile to use Python-based dependencies and removed redundant npm configuration.
- Cleaned up `package.json`, `requirements.txt`, and outdated scripts to streamline the project.
- Enhanced development workflow with a lightweight Python-based approach.

* Replace `python -m sass` with `pysassc` for SCSS compilation in development scripts

* **Refactor and streamline MkDocs workflows, footer, and blog structure**

- Removed outdated `deploy-preview-fix.yml` and `deploy-test.yml` workflows for cleanup.
- Enhanced `deploy-preview.yml`:
  - Expanded branch triggers to include `build/**`, `test/**`, and `preview/**`.
  - Improved `site_url` logic by standardizing URL formatting.
- Updated `mkdocs.yml` navigation to use consistent `index.md` file naming.
- Simplified footer template to use relative paths for internal links (e.g., `impressum/`, `datenschutz/`).
- Adjusted `mkdocs.sh` to ensure SCSS watcher includes `overrides`.
- Deleted outdated `Sequential Thinking` blog and branch documentation for better maintenance.

* Update to Python 3.13 and streamline MkDocs workflows

- Upgraded Dockerfile base image to `python:3.13-slim-bullseye` for consistency with the latest Python version.
- Consolidated MkDocs and plugin installation steps in `deploy-preview.yml`.
- Replaced Node.js SCSS tools with Python `pysassc` for CSS build process, removing unnecessary npm steps.

* Replace `mkdocs-lightbox` with `mkdocs-glightbox` and improve CSS build step in GitHub Actions workflow

- Updated `deploy-preview.yml` to switch from `mkdocs-lightbox` to `mkdocs-glightbox` for better compatibility and features.
- Enhanced CSS build logic to create the target directory (`docs/assets/css`) if it does not exist, ensuring a smoother workflow execution.

* Streamline deploy workflows and enhance CSS build process

- Added repository-specific condition to `deploy-live.yml` for improved workflow targeting.
- Consolidated MkDocs and plugin installation steps in `deploy-live.yml` to remove redundant tasks.
- Enhanced CSS build step to ensure target directory creation (`mkdir -p docs/assets/css`) in both workflows.
This commit is contained in:
mw
2025-06-02 14:03:20 +02:00
committed by GitHub
parent 4afa183364
commit 887fe536d6
15 changed files with 205 additions and 721 deletions
+24 -22
View File
@@ -4,11 +4,12 @@ on:
push:
branches:
- main-mkdocs
pull_request:
jobs:
deploy:
runs-on: ubuntu-22.04
# Add condition to ensure this only runs on the main repository
if: github.repository == 'satwareAG/satware.ai'
permissions:
contents: write
concurrency:
@@ -21,33 +22,34 @@ jobs:
with:
python-version: '3.13'
- name: Upgrade pip
- name: Install MkDocs and plugins
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt
pip install --upgrade pip
pip install \
cairosvg \
libsass \
mkdocs-exclude \
mkdocs-git-revision-date-localized-plugin \
mkdocs-lightbox \
mkdocs-include-markdown-plugin \
mkdocs-literate-nav \
mkdocs-macros-plugin \
mkdocs-material==9.6.14 \
"mkdocs-material[imaging]" \
mkdocs-minify-plugin \
mkdocs-redirects \
mkdocs-rss-plugin \
mkdocs-snippets \
mkdocs-video \
watchdog
- name: Build css
run: |
npm install
npm run scss:build
mkdir -p docs/assets/css
pysassc overrides/assets/css/custom.scss docs/assets/css/custom.css
- name: Build static site
run: mkdocs build
- name: Deploy
run: mkdocs gh-deploy --force
run: mkdocs gh-deploy --force
-71
View File
@@ -1,71 +0,0 @@
name: Preview Deployment (Fix)
on:
workflow_dispatch: # Ermöglicht manuelles Starten
push:
branches:
- 'blog/**'
- 'feature/**'
- 'fix/**'
jobs:
deploy-preview:
runs-on: ubuntu-22.04
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
- name: Upgrade pip
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt
- name: Configure site_url for fork preview
run: |
# Extract GitHub username and repo name
GITHUB_USER=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 1)
REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)
# Update site_url in mkdocs.yml for fork preview
if grep -q "^site_url:" mkdocs.yml; then
sed -i "s|^site_url:.*|site_url: https://$GITHUB_USER.github.io/${REPO_NAME}/|" mkdocs.yml
else
echo "site_url: https://$GITHUB_USER.github.io/${REPO_NAME}/" >> mkdocs.yml
fi
echo "Updated mkdocs.yml for preview deployment:"
cat mkdocs.yml
- name: Build css
run: |
npm install
npm run scss:build
- name: Build static site
run: mkdocs build
- name: Deploy to GitHub Pages
run: mkdocs gh-deploy --force
+33 -29
View File
@@ -1,12 +1,15 @@
name: Preview Deployment
name: MkDocs Preview Deployment
on:
workflow_dispatch: # Ermöglicht manuelles Starten
workflow_dispatch: # Allows manual triggering
push:
branches:
- 'feature/**' # Triggers only on pushes to branches containing '/'
- 'fix/**' # Triggers only on pushes to branches containing '/'
- 'blog/**' # Triggers only on pushes to branches containing '/'
- 'feature/**'
- 'fix/**'
- 'blog/**'
- 'build/**'
- 'test/**'
- 'preview/**'
jobs:
deploy-preview:
@@ -23,46 +26,47 @@ jobs:
with:
python-version: '3.13'
- name: Upgrade pip
- name: Install MkDocs and plugins
run: |
# install pip=>20.1 to use "pip cache dir"
python3 -m pip install --upgrade pip
- name: Get pip cache dir
id: pip-cache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: python3 -m pip install -r ./requirements.txt
pip install --upgrade pip
pip install \
cairosvg \
libsass \
mkdocs-exclude \
mkdocs-git-revision-date-localized-plugin \
mkdocs-glightbox \
mkdocs-include-markdown-plugin \
mkdocs-literate-nav \
mkdocs-macros-plugin \
mkdocs-material==9.6.14 \
"mkdocs-material[imaging]" \
mkdocs-minify-plugin \
mkdocs-redirects \
mkdocs-rss-plugin \
mkdocs-snippets \
mkdocs-video \
watchdog
- name: Configure site_url for fork preview
run: |
# Extract GitHub username and repo name
GITHUB_USER=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 1)
REPO_NAME=$(echo $GITHUB_REPOSITORY | cut -d '/' -f 2)
# Update site_url in mkdocs.yml for fork preview
if grep -q "^site_url:" mkdocs.yml; then
sed -i "s|^site_url:.*|site_url: https://$GITHUB_USER.github.io/${REPO_NAME}/|" mkdocs.yml
sed -i "s|^site_url:.*|site_url: https://${GITHUB_USER}.github.io/${REPO_NAME}/|" mkdocs.yml
else
echo "site_url: https://$GITHUB_USER.github.io/${REPO_NAME}/" >> mkdocs.yml
echo "site_url: https://${GITHUB_USER}.github.io/${REPO_NAME}/" >> mkdocs.yml
fi
echo "Updated mkdocs.yml for preview deployment:"
cat mkdocs.yml
- name: Build css
run: |
npm install
npm run scss:build
mkdir -p docs/assets/css
pysassc overrides/assets/css/custom.scss docs/assets/css/custom.css
- name: Build static site
run: mkdocs build
-64
View File
@@ -1,64 +0,0 @@
name: Deploy MkDocs to Test Environment
on:
push:
branches:
- test
workflow_dispatch: # Allows manual triggering
permissions:
contents: write
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mkdocs-material
pip install mkdocs-minify-plugin
pip install mkdocs-git-revision-date-localized-plugin
pip install mkdocs-blog-plugin
pip install pymdown-extensions
pip install mkdocs-macros-plugin
pip install mkdocs-glightbox
pip install mkdocs-include-markdown-plugin
pip install mkdocs-video
pip install mkdocs-rss-plugin
pip install mkdocs-snippets
pip install mkdocs-exclude
pip install mkdocs-git-revision-date-localized-plugin
pip install mkdocs-redirects
pip install mkdocs-literate-nav
pip install "mkdocs-material[imaging]"
pip install libsass
- name: Verify CNAME
run: |
mkdir -p docs
if [ ! -f docs/CNAME ]; then
echo "test.satware.ai" > docs/CNAME
fi
- name: Build css
run: python compile_scss.py
- name: Build site
run: mkdocs build
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./site
destination_dir: .
cname: test.satware.ai
force_orphan: true