diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..2280e22 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,34 @@ +name: Build & Deploy + +# Läuft automatisch bei jedem Push auf main — also auch dann, wenn VanVan (oder ich) im +# Adminbereich (/admin/) etwas ändert und Sveltia CMS das direkt als Commit ins Repo schreibt. +# So werden Änderungen ohne manuellen Schritt live auf https://vans-diy-bastelbedarf.pages.dev. +on: + push: + branches: [main] + workflow_dispatch: {} + +jobs: + deploy: + runs-on: ubuntu-latest + permissions: + contents: read + deployments: write + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: "22" + cache: "npm" + + - run: npm ci + + - run: npm run build + + - name: Deploy to Cloudflare Pages + uses: cloudflare/wrangler-action@v3 + with: + apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} + accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} + command: pages deploy dist --project-name=vans-diy-bastelbedarf --branch=main