Files
28k8-moonweb-org/.github/workflows/deploy.yml
T
2026-08-15 19:49:02 +02:00

52 lines
1.3 KiB
YAML

name: Build & Deploy
on:
push:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
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
- uses: cloudflare/wrangler-action@v4
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy