name: Deploy Marketing-Site on: push: branches: - main workflow_dispatch: concurrency: group: deploy-marketing cancel-in-progress: false jobs: build-and-deploy: name: Build, Test und Deploy runs-on: docker container: image: node:22-bookworm steps: - name: Checkout (inkl. Submodule brand-system) uses: actions/checkout@v4 with: submodules: recursive fetch-depth: 1 - name: pnpm aktivieren run: | corepack enable corepack prepare pnpm@latest --activate - name: Dependencies run: pnpm install --frozen-lockfile - name: Production-Build run: pnpm build - name: Playwright-Browser run: pnpm exec playwright install --with-deps chromium - name: Smoke-Tests gegen Production-Build run: pnpm exec playwright test env: CI: '1' - name: rsync + ssh installieren run: apt-get update && apt-get install -y --no-install-recommends rsync openssh-client - name: SSH-Key setzen if: github.ref == 'refs/heads/main' env: SSH_KEY: ${{ secrets.MARKETING_SSH_KEY }} HOST: ${{ secrets.MARKETING_HOST }} run: | mkdir -p ~/.ssh chmod 700 ~/.ssh echo "$SSH_KEY" > ~/.ssh/marketing chmod 600 ~/.ssh/marketing ssh-keyscan -H "$HOST" >> ~/.ssh/known_hosts 2>/dev/null - name: Rsync zu Marketing-VPS if: github.ref == 'refs/heads/main' run: | rsync -avz --delete \ -e "ssh -i ~/.ssh/marketing -o StrictHostKeyChecking=yes" \ dist/ \ "${{ secrets.MARKETING_USER }}@${{ secrets.MARKETING_HOST }}:slimcore.io/" - name: Deploy-Verifikation if: github.ref == 'refs/heads/main' run: | sleep 3 STATUS=$(curl -sI https://slimcore.io/ | awk '/HTTP\//{print $2; exit}') if [ "$STATUS" != "200" ]; then echo "slimcore.io liefert HTTP $STATUS, erwartet 200" exit 1 fi echo "✓ slimcore.io antwortet mit 200"