Files
ndsolutionswebsite/.gitea/workflows/deploy.yml
Workflow config file is invalid. Please check your config file: yaml: line 51: could not find expected ':'
DanielS a1cd443330 test
2026-07-01 00:37:28 +02:00

57 lines
1.6 KiB
YAML

name: Production Build & Deploy
on:
push:
branches:
- staging
jobs:
build-and-deploy:
runs-on: webserver
container:
image: catthehacker/ubuntu:act-latest
steps:
- name: Code auschecken
uses: actions/checkout@v4
- name: Docker login to Gitea registry
run: echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.hephex.de -u "${{ secrets.REGISTRY_USER }}" --password-stdin
- name: Build Docker image
run: |
docker build -t gitea.hephex.de/daniel/ndsolutionswebsite:latest -f Dockerfile .
- name: Push Docker image
run: docker push gitea.hephex.de/daniel/ndsolutionswebsite:latest
- name: Clean up runner Docker cache
run: |
docker image prune -f
docker builder prune -f
- name: Deploy via SSH to Debian Server
uses: appleboy/ssh-action@v1.0.3
with:
host: 192.168.178.164
username: ${{ secrets.PROXMOX_USER }}
key: ${{ secrets.PROXMOX_SSH_KEY }}
script: |
mkdir -p /opt/ndsolutionswebsite
cd /opt/ndsolutionswebsite
# Schreibt die Docker Compose Datei sauber ohne Einrückung
cat << 'EOF' > docker-compose.yml
version: '3.8'
services:
website:
image: gitea.hephex.de/daniel/ndsolutionswebsite:latest
restart: always
ports:
- "8080:80"
EOF
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login gitea.hephex.de -u "${{ secrets.REGISTRY_USER }}" --password-stdin
docker compose pull
docker compose up -d
docker image prune -f