Merge branch 'main' of gitea.psi.ch:pombas_n/gitea-pages
All checks were successful
Build and Deploy Documentation / build-and-deploy (push) Successful in 11s

This commit is contained in:
2025-12-18 16:57:37 +01:00
3 changed files with 135 additions and 11 deletions

54
docs/guides/cicd.md Normal file
View File

@@ -0,0 +1,54 @@
# CI / CD
```
name: Build and Deploy Documentation
# ON ist ein trigger
# Kann auch ein Cronjob sein (man cron)
on:
push:
branches:
- main
workflow_dispatch:
# Job description - Was soll er tun?
jobs:
build-and-deploy:
# Auf welchem Runner soll er laufen
# Werden angesteuert mit tags
runs-on: ubuntu-latest-intranet
container:
# Docker in Docker image welches für den job verwendet werden soll
image: gitea.psi.ch/images/alpine-mkdocs
# Job Schritte
steps:
- name: Checkout repository
# Actions sind hier zu finden: https://github.com/actions
uses: actions/checkout@v4
- name: Install Zensical
run: |
/opt/python-env/bin/pip install zensical
- name: Build Zensical docs
run: |
export TZ="Europe/Zurich"
/opt/python-env/bin/zensical build --clean
- name: Configure Git
run: |
git config --global user.name "Gitea Actions"
git config --global user.email "actions@gitea.local"
- name: Push to gitea-pages branch
run: |
git checkout --orphan gitea-pages
git reset --hard
cp -r ./site/* .
git add .
git commit -m "Deploy Zensical site"
git push -f https://${{ secrets.GITHUB_TOKEN }}@gitea.psi.ch/${{ github.repository }}.git gitea-pages
```

77
docs/guides/docker.md Normal file
View File

@@ -0,0 +1,77 @@
# Docker
## Dockerfiles
```
# Start with a minimal Python base image
FROM python:3.12-alpine
# Install dependencies
# Jeder Step (RUN befehl) generiert ein neuer image layer!
RUN apk add --no-cache git bash nodejs\
&& pip install --no-cache-dir \
mkdocs \
mkdocs-material \
mkdocs-mermaid2-plugin \
mkdocs-git-revision-date-localized-plugin \
mkdocs-macros-plugin
# Set work directory
# Environment variables -> Lookup :)
WORKDIR /site
# Default command
ENTRYPOINT ["mkdocs"]
```
### Altenative
```
FROM alpine
# 1. Install Python 3, pip and build tools (needed for packages with C extensions)
RUN apk --no-cache add\
python3 \
py3-pip \
git \
nodejs
# 2. Install the Python packages
RUN python3 -m venv /opt/python-env
RUN /opt/python-env/bin/python3 -m pip install --upgrade pip
RUN /opt/python-env/bin/pip install --no-cache-dir \
mkdocs-material \
mkdocs-awesome-pages-plugin
# 3. (Optional) Clean up if you added any temporary files
RUN rm -rf /var/cache/apk/*
```
## Dockerhub
(Not the other hub...)
- https://hub.docker.com/_/node
- https://hub.docker.com/_/postgres
- Optional : https://hub.docker.com/_/nginx
### Linux Webhosting
- https://linux.psi.ch/documentation/services/admin-guide/webhosting/?h=webhosting
- https://linux.psi.ch/documentation/engineering-guide/webhosting/?h=webhosting#update-containersi
- https://gitea.psi.ch/linux/WebHosting
## Docker registry
https://gitea.psi.ch/pombas_n/gitea-pages/packages
| Registry name | Organization Name | Repo Name | Version |
|---------------|-------------------|-----------|---------|
| gitea.psi.ch | images | alpine-zensical | latest |
```
gitea.psi.ch/images/alpine-zensical latest b5920bb288b0 7 days ago 206MB
```
!note Latest ist nicht gleicht das aktuellste package, es ist nur ein "alias" das packet muss jedesmal neu gebaut werden als latest und 1.2, 1.3 etc.

View File

@@ -1,14 +1,7 @@
# To Do
- [x] Complete Git Guide
- [x] Blockdiagramm
- [x] 8:15 Mittwoch morgen links (nicht vor de türe)
- [x] Komponente Liste BET 11
- [ ] Ferien
- [x] Other images like mkdocs, maybe other things like apache... what can mkdocs do, themes, extensions etc... better tool? *Look at it with Bruhn_b next week.*
- [ ] 5/20 Lernjournale
- [ ] SNOW Fundamentals Kurs 5/9 Modul
- [ ] Planung S-Lehre
- [ ] E-Mail Ende des Tages an AA (F)