diff --git a/.github/workflows/deploy-deno.yml b/.github/workflows/deploy-deno.yml index 6e07069..d2358a7 100644 --- a/.github/workflows/deploy-deno.yml +++ b/.github/workflows/deploy-deno.yml @@ -1,37 +1,32 @@ -name: Deploy to Deno Deploy +name: Deno Deploy on: push: - branches: - - main - - master - - development + branches-ignore: + - dist/** + tags-ignore: + - "**" workflow_dispatch: -permissions: - contents: read - id-token: write - jobs: deploy: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Setup Deno - uses: denoland/setup-deno@v2 - with: - deno-version: v2.x - - - name: Cache deps - run: deno task cache - - - name: Build static assets - run: deno task build - - - name: Deploy to Deno Deploy - uses: denoland/deployctl@v1 - with: - project: "ubq-fi" - entrypoint: "serve.ts" + uses: ubiquity/deno-deploy-workflow/.github/workflows/deno-deploy-reusable.yml@main + with: + project: ubq-fi + deploy_platform: deno2 + entrypoint: serve.ts + root: .deploy-root + install_command: deno install + build_command: | + deno task build + rm -rf .deploy-root + mkdir -p .deploy-root/static + cp -R static/. .deploy-root/static/ + cp serve.ts deno.json .deploy-root/ + if [ -f deno.lock ]; then + cp deno.lock .deploy-root/ + fi + debug_fetch_fail: true + required_env: | + DENO_DEPLOY_TOKEN + secrets: inherit diff --git a/README.md b/README.md index 237d8ec..422bd34 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ # Ubiquity DAO Website (ubq.fi) - TypeScript + esbuild bundling to `static/dist` -- Deployment: Deno Deploy via GitHub Actions OIDC +- Deployment: Deno 2 Deploy via `ubiquity-os/deno-deploy` (`.github/workflows/deploy-deno.yml`) - Local dev: `deno task start` serves `static` at http://localhost:8080 Deploy (CI): -- On push to `main`/`master`, CI builds and deploys using `denoland/deployctl`. -- Project name in Deno Deploy: `ubq-fi` +- On push to non-`dist/**` branches, CI builds and provisions a branch Deno app. +- Default branch app: `ubq-fi.ubiquity-dao.deno.net` - Entrypoint: `serve.ts` (serves `static/`) Custom Domain: diff --git a/deno.json b/deno.json index 929ed35..1df047c 100644 --- a/deno.json +++ b/deno.json @@ -3,6 +3,7 @@ "@std/http": "jsr:@std/http@^1.0.21", "esbuild": "npm:esbuild@0.20.1" }, + "nodeModulesDir": "auto", "tasks": { "start": "deno run --allow-net --allow-env --allow-run --allow-read --allow-write build/esbuild-server.ts", "build": "deno run --allow-net --allow-env --allow-run --allow-read --allow-write build/esbuild-build.ts",