t3-code-android-nightly/.repos/alchemy-effect/examples/cloudflare-website-astro/alchemy.run.ts

27 lines
724 B
TypeScript

import * as Alchemy from "alchemy";
import * as Cloudflare from "alchemy/Cloudflare";
import * as Effect from "effect/Effect";
export default Alchemy.Stack(
"CloudflareWebsiteAstroExample",
{
providers: Cloudflare.providers(),
state: Cloudflare.state(),
},
Effect.gen(function* () {
const site = yield* Cloudflare.Website.Astro("Astro", {
// Only hash the files that affect the build, so unchanged sources
// skip the Astro build (and the deploy) entirely.
memo: {
include: ["src/**", "public/**", "package.json", "astro.config.ts"],
},
env: {
GREETING: "Hello from Astro on Cloudflare!",
},
});
return {
url: site.url,
};
}),
);