commit 0c9fae95da5224df37255fca856ee72e0f5395aa Author: René Walther Date: Mon Dec 8 19:04:42 2025 +0100 Add daily Wiki build workflow and documentation diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..7784a0a --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +.git +.gitea +node_modules \ No newline at end of file diff --git a/.gitea/workflows/wiki-build.yaml b/.gitea/workflows/wiki-build.yaml new file mode 100644 index 0000000..81f04a6 --- /dev/null +++ b/.gitea/workflows/wiki-build.yaml @@ -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 \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6ebf989 --- /dev/null +++ b/Dockerfile @@ -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;"] \ No newline at end of file diff --git a/agents.md b/agents.md new file mode 100644 index 0000000..9b3a92c --- /dev/null +++ b/agents.md @@ -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/: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. \ No newline at end of file