Files
klz-cables.com/.gitea/workflows/deploy.yml
Marc Mintel bb98014ea1
Some checks failed
Build & Deploy KLZ Cables / build-and-deploy (push) Failing after 4m43s
deploy
2026-01-25 23:44:44 +01:00

58 lines
2.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
name: Build & Deploy KLZ Cables
on:
push:
branches: [main]
jobs:
build-and-deploy:
# ────────────────────────────────────────────────
# WICHTIG: Kein "docker" mehr sondern eines der neuen Labels
runs-on: docker
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Login to private registry
run: |
echo "${{ secrets.REGISTRY_PASS }}" | \
docker login registry.infra.mintel.me \
-u "${{ secrets.REGISTRY_USER }}" --password-stdin
- name: Build Docker image
run: |
docker buildx build \
--pull \
--platform linux/arm64 \
--build-arg NEXT_PUBLIC_UMAMI_WEBSITE_ID="${{ secrets.NEXT_PUBLIC_UMAMI_WEBSITE_ID }}" \
--build-arg NEXT_PUBLIC_UMAMI_SCRIPT_URL="${{ secrets.NEXT_PUBLIC_UMAMI_SCRIPT_URL }}" \
--build-arg NEXT_PUBLIC_SENTRY_DSN="${{ secrets.SENTRY_DSN }}" \
-t registry.infra.mintel.me/mintel/klz-cables.com:latest \
--push .
# Alternative ohne Buildx (wenn du kein Multi-Platform brauchst):
# docker build \
# --pull \
# --build-arg ... \
# -t registry.infra.mintel.me/mintel/klz-cables.com:latest .
# docker push registry.infra.mintel.me/mintel/klz-cables.com:latest
- name: Deploy to production server
run: |
mkdir -p ~/.ssh
echo "${{ secrets.ALPHA_SSH_KEY }}" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H alpha.mintel.me >> ~/.ssh/known_hosts 2>/dev/null
ssh -o StrictHostKeyChecking=accept-new deploy@alpha.mintel.me << 'EOF'
docker login registry.infra.mintel.me \
-u "${{ secrets.REGISTRY_USER }}" \
-p "${{ secrets.REGISTRY_PASS }}"
cd /home/deploy/sites/klz-cables.com
docker compose pull
docker compose up -d --force-recreate --remove-orphans
docker image prune -f
EOF