Add daily Wiki build workflow and documentation

This commit is contained in:
rewa81 committed 2025-12-08 19:04:42 +01:00
commit 0c9fae95da
4 files changed
+116

No files matched your search

+3
View File
@@ -0,0 +1,3 @@
.git
.gitea
node_modules
+36
View File
@@ -0,0 +1,36 @@
name: Daily Wiki Build
on:
schedule:
# Montag bis Freitag um 18:00 Uhr
- cron: '0 18 * * 1-5'
# Erlaubt manuelles Starten des Workflows
workflow_dispatch:
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout Wiki repository
uses: actions/checkout@v4
with:
repository: mint-systems/Wiki
path: wiki-src
# Falls das Repo privat ist, wird hier ein Token benötigt:
# token: ${{ secrets.REPO_ACCESS_TOKEN }}
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: gitea.rwcloud.ch
username: build.user
password: ${{ secrets.BUILDUSER_AUTHTOKEN }}
- name: Build and push Docker images
uses: docker/build-push-action@v6.15.0
with:
push: true
pull: true
context: .
dockerfile: Dockerfile
tags: gitea.rwcloud.ch/mint-systems/mint-wiki:latest
+32
View File
@@ -0,0 +1,32 @@
# Stage 1: Build the VuePress application
FROM node:18-alpine AS builder
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json (if available)
COPY wiki-src/package*.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the application code
COPY wiki-src/ .
# Build the application
# VuePress build command usually outputs to .vuepress/dist
RUN npm run build
# Stage 2: Serve the application with Nginx
FROM gitea.rwcloud.ch/official-docker-images/nginx:alpine
# Copy the built files from the builder stage
# Adjust the source path if your VuePress config outputs somewhere else
# Common paths: src/.vuepress/dist or .vuepress/dist
COPY --from=builder /app/src/.vuepress/dist /usr/share/nginx/html
# Expose port 80
EXPOSE 80
# Start Nginx
CMD ["nginx", "-g", "daemon off;"]
+45
View File
@@ -0,0 +1,45 @@
# Projekt-Kontext: Docker Image Deployment
Dieses Projekt konzentriert sich auf das Erstellen und Pushen von Docker-Images in die private Registry `gitea.rwcloud.ch` unter Verwendung von Gitea Actions.
## Infrastruktur & Tools
- **CI/CD:** Gitea Actions
- **Registry:** `gitea.rwcloud.ch`
- **User:** `build.user`
- **Secret für Passwort:** `BUILDUSER_AUTHTOKEN`
## Workflow-Standards
Für Pipelines, die Docker-Images bauen und veröffentlichen, sollen folgende Aktionen verwendet werden:
### 1. Login in die Registry
```yaml
- name: Login to Registry
uses: docker/login-action@v3
with:
registry: gitea.rwcloud.ch
username: build.user
password: ${{ secrets.BUILDUSER_AUTHTOKEN }}
```
### 2. Build und Push
```yaml
- name: Build and push Docker images
uses: docker/build-push-action@v6.15.0
with:
push: true
pull: true
# Context und Dockerfile Pfad anpassen (z.B. ./code-server)
context: .
# Tags entsprechend anpassen
tags: gitea.rwcloud.ch/homelab/<image-name>:latest
```
## Hinweise
- Stelle sicher, dass `push: true` gesetzt ist, um das Image hochzuladen.
- `pull: true` wird empfohlen, um Layer zu cachen/zu ziehen.
- Pfade für `context` und `dockerfile` müssen relativ zum Repository-Root sein.