mirror of
https://github.com/skoelle/28k8-moonweb-org.git
synced 2026-09-17 18:30:24 +00:00
build and deploy
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user