# Deploy windwiderstand SvelteKit auf Contabo bei Push auf main. # # Setup auf dem Server (einmalig): # mkdir -p /opt/windwiderstand # DNS: windwiderstand.de + www.windwiderstand.de A → 167.86.74.105 # # Gitea Secrets (Repo → Settings → Secrets): # SSH_DEPLOY_KEY ~/.ssh/contabo_rsa (privat) # REGISTRY_USER Gitea-Username # REGISTRY_TOKEN Gitea Access Token (Scope: package) # PUBLIC_CMS_URL https://cms.pm86.de # PUBLIC_SITE_URL https://windwiderstand.de # PUBLIC_SITE_NAME Windwiderstand # ORIGIN https://windwiderstand.de # REVALIDATE_TOKEN openssl rand -hex 32 # PUBLIC_UMAMI_WEBSITE_ID (optional, sonst leer) name: Deploy on: push: branches: [main] jobs: verify: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: "22" cache: npm - name: Install deps run: npm ci - name: Generate icons subset run: npm run generate:icons - name: SvelteKit sync run: npx svelte-kit sync - name: Typecheck (svelte-check) run: npx svelte-check --threshold error - name: Typecheck (tsc) run: npx tsc --noEmit deploy: needs: verify runs-on: ubuntu-latest env: DEPLOY_HOST: root@167.86.74.105 DEPLOY_DIR: /opt/windwiderstand IMAGE: git.pm86.de/admin/windwiderstand:latest steps: - uses: actions/checkout@v4 - name: Build and push image run: | echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.pm86.de -u ${{ secrets.REGISTRY_USER }} --password-stdin docker build -t $IMAGE . docker push $IMAGE - name: Setup SSH run: | mkdir -p ~/.ssh echo "${{ secrets.SSH_DEPLOY_KEY }}" > ~/.ssh/deploy_key chmod 600 ~/.ssh/deploy_key cat > ~/.ssh/config < $DEPLOY_DIR/.env" <> /opt/caddy/extra-config/Caddyfile' ssh vserver "docker exec caddy caddy reload --config /extra-config/Caddyfile" - name: Cleanup if: always() run: rm -f ~/.ssh/deploy_key