feat: deploy on cloudflare pages

This commit is contained in:
2025-01-10 12:53:53 +01:00
parent 56f1761d0a
commit 0aff360d43
3 changed files with 11 additions and 6 deletions

View File

@ -6,13 +6,15 @@ import rehypeAutolinkHeadings from 'rehype-autolink-headings'
import node from '@astrojs/node'
import sitemap from '@astrojs/sitemap'
import cloudflare from '@astrojs/cloudflare'
// https://astro.build/config
export default defineConfig({
site: 'https://vikunja.io',
output: 'static',
integrations: [
tailwind(),
markdoc(),
tailwind(),
markdoc(),
sitemap({
serialize(item) {
if (item.url.endsWith('/')) {
@ -23,9 +25,7 @@ export default defineConfig({
},
}),
],
adapter: node({
mode: 'standalone',
}),
adapter: cloudflare(),
markdown: {
rehypePlugins: [
rehypeSlug,

View File

@ -3,6 +3,10 @@
let
unstable = import inputs.unstable { system = pkgs.stdenv.system; };
in {
scripts.patch-workerd.exec = ''
find node_modules/.pnpm/@cloudflare+workerd-linux-64@*/node_modules/@cloudflare/workerd-linux-64/bin/ -name workerd -print0 | xargs -I {} -0 patchelf --set-interpreter "$(<$NIX_CC/nix-support/dynamic-linker)" {}
'';
languages.javascript = {
enable = true;
pnpm = {

View File

@ -9,7 +9,8 @@
"preview": "astro preview",
"astro": "astro",
"lint": "astro check --root ./src",
"serve-dist": "node ./dist/server/entry.mjs"
"serve-dist": "node ./dist/server/entry.mjs",
"deploy-cf": "pnpm run build && wrangler pages deploy dist"
},
"dependencies": {
"@astrojs/check": "^0.9.4",