Skip to content
Source
Sign inSign up
fuko/trytanstackdb.com

Deploy v2 to v2.trytanstackdb.com with cf from TanStack Source CI #100002 (GitHub #52)

Mergedfukomerged 2 commits intov2 fromdeploy-v2-subdomainmerged by fuko View on GitHub

Showing 9 changed files with 43 additions and 4 deletions (loading 5).

x
0 of 9 viewed, 9 left
32 additions and 0 deletions.source/workflows/ci.tsAdded
View file
@@ -0,0 +1,32 @@
+import { defineWorkflow, pullRequest, push } from "@tanstack-source/ci";
+​
+// `setup.pnpm()` reads only the top-level `packageManager` field, but this
+// project names its pnpm in `devEngines.packageManager`.
+const setupPnpm = {
+ name: "Set up pnpm",
+ run: `npm install --global "pnpm@$(node -p 'require("./package.json").devEngines.packageManager.version')"`,
+};
+const install = { name: "Install", run: "pnpm install --frozen-lockfile" };
+​
+// Checks every pull request into `v2`, and deploys each push to `v2` to
+// https://v2.trytanstackdb.com (see `cloudflare.config.ts`).
+export default defineWorkflow("ci", {
+ on: [pullRequest({ branches: ["v2"] }), push({ branches: ["v2"] })],
+})
+ .job("check", {
+ egress: ["registry.npmjs.org"],
+ steps: [
+ setupPnpm,
+ install,
+ { name: "Format, lint and type check", run: "pnpm exec vp check" },
+ { name: "Test", run: "pnpm exec vp test" },
+ ],
+ })
+ .job("deploy", {
+ needs: ["check"],
+ if: (ctx) => ctx.event === "push",