build and deploy

This commit is contained in:
2026-08-15 18:59:10 +02:00
parent 8a6a1fcf07
commit 7327b746be
+48
View File
@@ -0,0 +1,48 @@
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
- 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