Skip to content
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
106 changes: 106 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# GitHub Actions Workflows

## Übersicht

### Release & Deployment Workflows

#### `main-release.yml` (Haupt-Release-Pipeline)

Läuft automatisch bei jedem Push auf `main`:

1. **Semantic Release** - Erstellt neue Releases basierend auf Conventional Commits
2. **Docker Build Backend** - Baut und pusht Backend-Image nach ghcr.io
3. **Docker Build Frontend** - Baut und pusht Frontend-Image nach ghcr.io
4. **Summary** - Zeigt Übersicht aller Artefakte

**Outputs:**

- GitHub Release mit Binaries
- Docker Images: `ghcr.io/cs-foundry/csf-core-backend:latest` & `:version`
- Docker Images: `ghcr.io/cs-foundry/csf-core-frontend:latest` & `:version`

#### `release.yml` (Wiederverwendbarer Release-Workflow)

Wird von `main-release.yml` aufgerufen:

- Führt Semantic Release aus
- Baut Backend-Binaries (Linux/macOS)
- Baut Frontend-Package
- Lädt alle Artefakte zum Release hoch

#### `docker-build-manual.yml` (Manuelles Docker-Build)

Manueller Workflow für Docker-Builds:

- Auswahl: Backend, Frontend oder beides
- Eigene Versionsnummer angeben
- Erstellt Tags: `<version>` und `manual-latest`

### Weitere Workflows

#### `beta-release.yml`

Release-Pipeline für Beta-Versionen auf dem `beta` Branch

#### `docker-build-push.yml`

Legacy-Workflow für das vereinigte Backend+Frontend Image

#### `build-artifacts.yml`

Standalone-Workflow für Binary-Builds

#### `lint.yml`

Code-Quality-Checks (Rust, TypeScript, etc.)

## Verwendung

### Automatischer Release (main)

```bash
git commit -m "feat: neue Feature"
git push origin main
# → Automatischer Release + Docker Images
```

### Manueller Docker-Build

1. GitHub Actions → **Manual Docker Build**
2. **Run workflow** klicken
3. Version eingeben (z.B. `1.2.3`)
4. Target auswählen (backend/frontend/both)
5. **Run workflow** ausführen

## Image-URLs

Nach erfolgreichem Build sind die Images verfügbar unter:

```bash
# Backend
ghcr.io/cs-foundry/csf-core-backend:latest
ghcr.io/cs-foundry/csf-core-backend:<version>

# Frontend
ghcr.io/cs-foundry/csf-core-frontend:latest
ghcr.io/cs-foundry/csf-core-frontend:<version>
```

## Permissions

Die Workflows benötigen folgende Permissions:

- `contents: write` - Für Releases
- `packages: write` - Für Docker Registry
- `issues: write` - Für Issue-Updates
- `pull-requests: write` - Für PR-Updates

## Secrets

Keine zusätzlichen Secrets erforderlich - verwendet `GITHUB_TOKEN` automatisch.

## Weitere Dokumentation

- [Docker Registry Integration](../docs/deployment/DOCKER_REGISTRY.md)
- [NixOS Deployment](../docs/deployment/DEPLOYMENT.md)
- [Installation Guide](../docs/deployment/INSTALLATION.md)
116 changes: 116 additions & 0 deletions .github/workflows/docker-build-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
name: Manual Docker Build

on:
workflow_dispatch:
inputs:
version:
description: "Version tag (e.g., 1.2.3)"
required: true
type: string
build_target:
description: "What to build"
required: true
type: choice
options:
- both
- backend
- frontend

permissions:
contents: read
packages: write

jobs:
build-backend:
name: Build Backend Docker Image
runs-on: ubuntu-latest
if: inputs.build_target == 'both' || inputs.build_target == 'backend'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Convert repository name to lowercase
id: repo
run: |
echo "image_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Backend Docker image
uses: docker/build-push-action@v5
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
ghcr.io/${{ steps.repo.outputs.image_name }}-backend:${{ inputs.version }}
ghcr.io/${{ steps.repo.outputs.image_name }}-backend:manual-latest
cache-from: type=gha,scope=backend
cache-to: type=gha,mode=max,scope=backend
platforms: linux/amd64

- name: Summary
run: |
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "## 🐳 Backend Docker Image Built" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "ghcr.io/${REPO_LOWER}-backend:${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "ghcr.io/${REPO_LOWER}-backend:manual-latest" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY

build-frontend:
name: Build Frontend Docker Image
runs-on: ubuntu-latest
if: inputs.build_target == 'both' || inputs.build_target == 'frontend'
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Convert repository name to lowercase
id: repo
run: |
echo "image_name=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Frontend Docker image
uses: docker/build-push-action@v5
with:
context: ./frontend
file: ./frontend/Dockerfile.prod
push: true
tags: |
ghcr.io/${{ steps.repo.outputs.image_name }}-frontend:${{ inputs.version }}
ghcr.io/${{ steps.repo.outputs.image_name }}-frontend:manual-latest
cache-from: type=gha,scope=frontend
cache-to: type=gha,mode=max,scope=frontend
platforms: linux/amd64

- name: Summary
run: |
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
echo "## 🐳 Frontend Docker Image Built" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Tags:**" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "ghcr.io/${REPO_LOWER}-frontend:${{ inputs.version }}" >> $GITHUB_STEP_SUMMARY
echo "ghcr.io/${REPO_LOWER}-frontend:manual-latest" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
Loading
Loading