chore: remove test trigger file
This commit is contained in:
155
deployment/NATIVE-WORKFLOW-README.md
Normal file
155
deployment/NATIVE-WORKFLOW-README.md
Normal file
@@ -0,0 +1,155 @@
|
||||
# Native Workflow ohne GitHub Actions
|
||||
|
||||
## Problem
|
||||
|
||||
Der aktuelle Workflow (`production-deploy.yml`) verwendet GitHub Actions wie:
|
||||
- `actions/checkout@v4`
|
||||
- `shivammathur/setup-php@v2`
|
||||
- `actions/cache@v3`
|
||||
- `docker/setup-buildx-action@v3`
|
||||
- `docker/build-push-action@v5`
|
||||
|
||||
Diese Actions müssen von GitHub geladen werden, was zu Abbrüchen führen kann wenn:
|
||||
- GitHub nicht erreichbar ist
|
||||
- Actions nicht geladen werden können
|
||||
- Timeouts auftreten
|
||||
|
||||
## Lösung: Native Workflow
|
||||
|
||||
Die Datei `.gitea/workflows/production-deploy-native.yml` verwendet **nur Shell-Commands** und keine GitHub Actions:
|
||||
|
||||
### Vorteile
|
||||
|
||||
1. **Keine GitHub-Abhängigkeit**: Funktioniert komplett offline
|
||||
2. **Schneller**: Keine Action-Downloads
|
||||
3. **Weniger Fehlerquellen**: Direkte Shell-Commands statt Actions
|
||||
4. **Einfacher zu debuggen**: Standard-Bash-Scripts
|
||||
|
||||
### Änderungen
|
||||
|
||||
#### 1. Checkout
|
||||
**Vorher:**
|
||||
```yaml
|
||||
- uses: actions/checkout@v4
|
||||
```
|
||||
|
||||
**Nachher:**
|
||||
```bash
|
||||
git clone --depth 1 --branch "$REF_NAME" \
|
||||
"https://git.michaelschiemer.de/${{ github.repository }}.git" \
|
||||
/workspace/repo
|
||||
```
|
||||
|
||||
#### 2. PHP Setup
|
||||
**Vorher:**
|
||||
```yaml
|
||||
- uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: '8.3'
|
||||
```
|
||||
|
||||
**Nachher:**
|
||||
```bash
|
||||
apt-get update
|
||||
apt-get install -y php8.3 php8.3-cli php8.3-mbstring ...
|
||||
```
|
||||
|
||||
#### 3. Cache
|
||||
**Vorher:**
|
||||
```yaml
|
||||
- uses: actions/cache@v3
|
||||
```
|
||||
|
||||
**Nachher:**
|
||||
```bash
|
||||
# Einfaches Datei-basiertes Caching
|
||||
if [ -d "/tmp/composer-cache/vendor" ]; then
|
||||
cp -r /tmp/composer-cache/vendor /workspace/repo/vendor
|
||||
fi
|
||||
```
|
||||
|
||||
#### 4. Docker Buildx
|
||||
**Vorher:**
|
||||
```yaml
|
||||
- uses: docker/setup-buildx-action@v3
|
||||
```
|
||||
|
||||
**Nachher:**
|
||||
```bash
|
||||
docker buildx create --name builder --use || docker buildx use builder
|
||||
docker buildx inspect --bootstrap
|
||||
```
|
||||
|
||||
#### 5. Docker Build/Push
|
||||
**Vorher:**
|
||||
```yaml
|
||||
- uses: docker/build-push-action@v5
|
||||
```
|
||||
|
||||
**Nachher:**
|
||||
```bash
|
||||
docker buildx build \
|
||||
--file ./Dockerfile.production \
|
||||
--tag $REGISTRY/$IMAGE_NAME:latest \
|
||||
--push \
|
||||
.
|
||||
```
|
||||
|
||||
## Verwendung
|
||||
|
||||
### Option 1: Native Workflow aktivieren
|
||||
|
||||
1. **Benenne um:**
|
||||
```bash
|
||||
mv .gitea/workflows/production-deploy.yml .gitea/workflows/production-deploy-with-actions.yml.bak
|
||||
mv .gitea/workflows/production-deploy-native.yml .gitea/workflows/production-deploy.yml
|
||||
```
|
||||
|
||||
2. **Commite und pushe:**
|
||||
```bash
|
||||
git add .gitea/workflows/production-deploy.yml
|
||||
git commit -m "chore: switch to native workflow without GitHub Actions"
|
||||
git push origin main
|
||||
```
|
||||
|
||||
### Option 2: Beide parallel testen
|
||||
|
||||
Lass beide Workflows parallel laufen:
|
||||
- `production-deploy.yml` - Mit Actions (aktuell)
|
||||
- `production-deploy-native.yml` - Native (neue Version)
|
||||
|
||||
## Gitea Actions Konfiguration
|
||||
|
||||
**Wichtig:** Wenn wir die native Version verwenden, brauchen wir `DEFAULT_ACTIONS_URL` **nicht mehr** in der Gitea-Konfiguration.
|
||||
|
||||
Aber es schadet auch nicht, es drin zu lassen für zukünftige Workflows.
|
||||
|
||||
## Debugging
|
||||
|
||||
Wenn der native Workflow nicht funktioniert:
|
||||
|
||||
1. **Prüfe Git Clone:**
|
||||
```bash
|
||||
# Im Runner Container
|
||||
git clone --depth 1 https://git.michaelschiemer.de/michael/michaelschiemer.git /tmp/test
|
||||
```
|
||||
|
||||
2. **Prüfe Docker Buildx:**
|
||||
```bash
|
||||
docker buildx version
|
||||
docker buildx ls
|
||||
```
|
||||
|
||||
3. **Prüfe PHP Installation:**
|
||||
```bash
|
||||
php --version
|
||||
php -m # Zeigt installierte Module
|
||||
```
|
||||
|
||||
## Empfehlung
|
||||
|
||||
**Für Stabilität:** Verwende die native Version (`production-deploy-native.yml`)
|
||||
|
||||
**Für Kompatibilität:** Bleib bei der Actions-Version (`production-deploy.yml`)
|
||||
|
||||
Die native Version sollte stabiler sein, da sie keine externen Dependencies benötigt.
|
||||
Reference in New Issue
Block a user