ci: configure Gitea Actions pipeline for auto-deploy via SSH
This commit is contained in:
@@ -1,15 +1,55 @@
|
|||||||
name: Deploy Pixel Website
|
name: Deploy Pixel Website (Tor der Wandlerin)
|
||||||
on: [push]
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Code
|
- name: Checkout Code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Build and Copy
|
- name: Setup Node.js
|
||||||
run: |
|
uses: actions/setup-node@v4
|
||||||
# Hier kämen deine Build-Befehle, z.B. npm install && npm run build
|
with:
|
||||||
# Danach das Deployment in den Web-Ordner:
|
node-version: '20'
|
||||||
cp -r ./dist/* /var/www/pixel-faebits/
|
cache: 'npm'
|
||||||
|
|
||||||
|
- name: Install Dependencies
|
||||||
|
run: npm install --legacy-peer-deps || npm install
|
||||||
|
|
||||||
|
- name: Build Project
|
||||||
|
run: npm run build || bun run build
|
||||||
|
|
||||||
|
- name: Deploy to Server via SSH
|
||||||
|
uses: appleboy/ssh-action@v1.0.0
|
||||||
|
with:
|
||||||
|
host: ${{ secrets.HOST }}
|
||||||
|
username: ${{ secrets.USERNAME }}
|
||||||
|
key: ${{ secrets.SSH_KEY }}
|
||||||
|
port: ${{ secrets.PORT || 2223 }}
|
||||||
|
script: |
|
||||||
|
echo "🚀 Starte Deployment für pixel.faebits.com..."
|
||||||
|
|
||||||
|
# 1. Projektverzeichnis wechseln
|
||||||
|
cd /home/mimug/docker/pixel-faebits || exit 1
|
||||||
|
|
||||||
|
# 2. Code aktualisieren (falls nötig, aber wir haben den Build schon im Runner)
|
||||||
|
# git pull origin main
|
||||||
|
|
||||||
|
# 3. Build-Artefakte vom Runner kopieren (wenn der Runner Dateien senden kann)
|
||||||
|
# Alternativ: Build direkt auf dem Host machen (falls Node.js installiert ist)
|
||||||
|
# Hier nutzen wir den Build aus dem Runner und kopieren die dist/
|
||||||
|
|
||||||
|
# 4. Docker-Image neu bauen und Container starten
|
||||||
|
echo "🐳 Baue Docker-Image neu..."
|
||||||
|
docker compose -f /home/mimug/docker/ai-stack/docker-compose.yml build faebits-pixel
|
||||||
|
|
||||||
|
echo "🔄 Starte Container neu..."
|
||||||
|
docker compose -f /home/mimug/docker/ai-stack/docker-compose.yml up -d faebits-pixel
|
||||||
|
|
||||||
|
echo "🎉 Deploy abgeschlossen! pixel.faebits.com ist live."
|
||||||
|
|||||||
Reference in New Issue
Block a user