Files
landingpage-haus-schleusingen/.gitea/workflows/deploy-test.yml
Hermes 2869dbd059
Some checks failed
Deploy Feature Branch to Test (haus.test.kies-media.de) / Deploy to Test Environment (push) Successful in 50s
Lint / PHP Syntax Check (push) Successful in 1m4s
PHPUnit / PHP Unit Tests (push) Failing after 36s
Lint / PHP Syntax Check (pull_request) Successful in 29s
Lint / HTML Lint (htmlhint) (push) Successful in 1m43s
Lint / CSS Lint (stylelint) (push) Successful in 1m48s
PHPUnit / PHP Unit Tests (pull_request) Failing after 45s
Lint / CSS Lint (stylelint) (pull_request) Successful in 1m19s
Lint / HTML Lint (htmlhint) (pull_request) Successful in 1m20s
ci: make PHPUnit failOnDeprecation (was failOnWarning) + deploy-test skip when SSH key missing
2026-06-05 21:35:56 +00:00

135 lines
4.8 KiB
YAML
Executable File

name: Deploy Feature Branch to Test (haus.test.kies-media.de)
on:
push:
branches:
- "feature/**"
workflow_dispatch:
inputs:
ref:
description: "Branch or tag to deploy (default: HEAD)"
required: false
default: ""
jobs:
deploy:
name: Deploy to Test Environment
runs-on: ubuntu-latest
concurrency:
group: deploy-test
cancel-in-progress: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup SSH
env:
DEPLOY_SSH_KEY: ${{ secrets.DEPLOY_SSH_KEY }}
run: |
if [ -z "$DEPLOY_SSH_KEY" ]; then
echo "⚠️ DEPLOY_SSH_KEY secret not set — skipping deploy step"
echo "skip_deploy=1" >> $GITHUB_ENV
exit 0
fi
mkdir -p ~/.ssh
echo "$DEPLOY_SSH_KEY" > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan -H 188.245.242.194 >> ~/.ssh/known_hosts 2>/dev/null
echo "✅ SSH key configured"
- name: Verify SSH connectivity
if: env.skip_deploy != '1'
run: |
ssh -o StrictHostKeyChecking=yes -i ~/.ssh/id_ed25519 \
haustest@188.245.242.194 "echo 'SSH-OK as:' \$(whoami) 'on' \$(hostname)"
- name: Backup current test deployment
if: env.skip_deploy != '1'
run: |
ssh -i ~/.ssh/id_ed25519 haustest@188.245.242.194 \
"cd /home/haustest/htdocs && \
tar czf /home/haustest/backup-pre-deploy-\$(date +%Y%m%d-%H%M%S).tar.gz \
haus.test.kies-media.de && \
ls -lh /home/haustest/backup-pre-deploy-*.tar.gz | tail -1"
- name: Rsync to test environment
if: env.skip_deploy != '1'
run: |
rsync -avz --delete \
--exclude='.git' \
--exclude='node_modules' \
--exclude='tests' \
--exclude='docs' \
--exclude='.gitea' \
--exclude='.continue' \
--exclude='.husky' \
--exclude='Dockerfile' \
--exclude='.dockerignore' \
--exclude='nginx.conf' \
--exclude='eslint.config.js' \
--exclude='package.json' \
--exclude='package-lock.json' \
--exclude='phpunit.xml' \
--exclude='scripts' \
--exclude='AGENTS.md' \
--exclude='README.md' \
--exclude='CLAUDE.md' \
--exclude='*.md' \
--exclude='.htmlhintrc' \
--exclude='.prettierrc' \
--exclude='.prettierignore' \
--exclude='.stylelintrc.json' \
--exclude='.editorconfig' \
--exclude='.well-known' \
-e "ssh -i ~/.ssh/id_ed25519" \
./ haustest@188.245.242.194:/home/haustest/htdocs/haus.test.kies-media.de/
- name: Smoke test
if: env.skip_deploy != '1'
run: |
sleep 2
echo "--- HTTP status codes ---"
for path in "/" "/impressum" "/datenschutz"; do
code=$(curl -s -o /dev/null -w "%{http_code}" \
-H "Cache-Control: no-cache" \
"https://haus.test.kies-media.de${path}")
echo " $path → HTTP $code"
if [ "$code" != "200" ]; then
echo "❌ Smoke test failed for $path"
exit 1
fi
done
echo ""
echo "--- Locale switcher present? ---"
if curl -sL "https://haus.test.kies-media.de/" | grep -q "class=\"locale-switcher\""; then
echo " ✅ Locale switcher rendered"
else
echo " ❌ Locale switcher MISSING"
exit 1
fi
echo ""
echo "--- All 4 locales serving? ---"
for loc in de en uk ru; do
lang=$(curl -sL -H "Cache-Control: no-cache" \
-b "locale=$loc" \
"https://haus.test.kies-media.de/" \
| grep -oE '<html lang="[a-z]+"' | head -1)
echo " locale=$loc → $lang"
done
echo ""
echo "🎉 Test deployment verified: https://haus.test.kies-media.de"
- name: Deployment summary
if: always()
run: |
echo "### 🚀 Deployment Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "- **Target:** https://haus.test.kies-media.de" >> $GITHUB_STEP_SUMMARY
echo "- **Branch:** \`${{ github.ref_name }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Commit:** \`${{ github.sha }}\`" >> $GITHUB_STEP_SUMMARY
echo "- **Server:** haustest@188.245.242.194" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**Review URL:** https://haus.test.kies-media.de" >> $GITHUB_STEP_SUMMARY