name: Build & Deploy on: push: branches: [main] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - uses: actions/setup-node@v7 with: node-version: 20 cache: npm - run: npm ci # prebuild.sh wird bewusst übersprungen — die JSON-Daten in src/data/ # wurden lokal generiert und ins Repo committed. Nur lokales `npm run build` # führt prebuild.sh aus. - run: npx astro build - uses: actions/upload-artifact@v4 with: name: dist path: dist/ deploy: name: Deploy to Cloudflare needs: build runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 with: name: dist path: dist/ - name: Create wrangler.toml run: | echo 'name = "moonweb-28k8"' > wrangler.toml echo 'compatibility_date = "2024-01-01"' >> wrangler.toml echo '' >> wrangler.toml echo '[assets]' >> wrangler.toml echo 'directory = "./dist"' >> wrangler.toml echo 'not_found_handling = "404-page"' >> wrangler.toml - uses: cloudflare/wrangler-action@v4 with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} command: deploy