Some checks failed
Build and Deploy Astro App / build_and_deploy (push) Failing after 24s
55 lines
No EOL
1.5 KiB
YAML
55 lines
No EOL
1.5 KiB
YAML
name: Build and Deploy Astro App
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build_and_deploy:
|
|
runs-on: roadrunner
|
|
defaults:
|
|
run:
|
|
working-directory: blog
|
|
steps:
|
|
- name: Repository auschecken
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Node.js einrichten
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: 'npm'
|
|
cache-dependency-path: 'blog/package-lock.json'
|
|
|
|
- name: Abhängigkeiten installieren
|
|
run: npm ci
|
|
|
|
- name: Astro-Projekt bauen
|
|
run: npm run build
|
|
|
|
- name: Auf Server deployen
|
|
run: |
|
|
echo "🚀 Deployment startet..."
|
|
rm -rf /var/www/astro-app/*
|
|
cp -r dist/* /var/www/astro-app/
|
|
restorecon -Rv /var/www/astro-app/
|
|
echo "✅ Deployment erfolgreich!"
|
|
|
|
- name: HTTPS-Erreichbarkeit prüfen
|
|
run: |
|
|
HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" https://blauwasser-mausis.de.de)
|
|
if [ "$HTTP_STATUS" -eq 200 ]; then
|
|
echo "✅ App erreichbar unter https://blauwasser-mausis.de.de (HTTP $HTTP_STATUS)"
|
|
else
|
|
echo "❌ App antwortet mit HTTP $HTTP_STATUS"
|
|
exit 1
|
|
fi
|
|
|
|
- name: TLS-Zertifikat prüfen
|
|
run: |
|
|
EXPIRY=$(echo | openssl s_client -connect blauwasser-mausis.de:443 \
|
|
-servername app.deine-domain.de 2>/dev/null \
|
|
| openssl x509 -noout -enddate 2>/dev/null \
|
|
| cut -d= -f2)
|
|
echo "🔒 Zertifikat gültig bis: $EXPIRY |