Skip to content

Commit d05d030

Browse files
committed
Use cf adapter for previews
1 parent 7ddc87d commit d05d030

File tree

5 files changed

+7
-14
lines changed

5 files changed

+7
-14
lines changed

.github/workflows/build-preview.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ jobs:
1717
repository: ${{ github.event.pull_request.head.repo.full_name }}
1818
- uses: oven-sh/setup-bun@v2
1919
- run: bun install
20-
- run: cd web && bun run buildPreview
20+
- run: cd web && bun run build
2121
- name: "upload build artifact"
2222
uses: "actions/upload-artifact@v4"
2323
with:
2424
name: "preview-build"
25-
path: "web/build"
25+
path: |
26+
node_modules
27+
web/.svelte-kit
28+
web/node_modules
29+
include-hidden-files: true

.github/workflows/deploy-preview.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ jobs:
3333
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
3434
githubToken: ${{ secrets.GITHUB_TOKEN }}
3535
projectName: "diffs"
36-
directory: ${{ steps.preview-build-artifact.outputs.download-path }}
36+
directory: ${{ steps.preview-build-artifact.outputs.download-path }}/web/.svelte-kit/cloudflare
3737
deploymentName: Preview

bun.lock

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
"scripts": {
77
"dev": "vite dev",
88
"build": "vite build",
9-
"buildPreview": "PREVIEW=true vite build",
109
"watch": "vite build --watch",
1110
"preview": "vite preview",
1211
"prepare": "svelte-kit sync || echo ''",
@@ -24,7 +23,6 @@
2423
"@octokit/openapi-types": "^25.1.0",
2524
"@sveltejs/adapter-auto": "^6.0.1",
2625
"@sveltejs/adapter-cloudflare": "^7.0.3",
27-
"@sveltejs/adapter-static": "^3.0.8",
2826
"@sveltejs/kit": "^2.21.2",
2927
"@sveltejs/vite-plugin-svelte": "^5.1.0",
3028
"@tailwindcss/vite": "^4.1.8",

web/svelte.config.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import bunAdapter from "svelte-adapter-bun";
22
import cloudflareAdapter from "@sveltejs/adapter-cloudflare";
3-
import staticAdapter from "@sveltejs/adapter-static";
43
import { vitePreprocess } from "@sveltejs/vite-plugin-svelte";
54

65
let adapter = cloudflareAdapter();
76
if (process.env.NODE_ENV === "development") {
87
adapter = bunAdapter();
98
}
10-
if (process.env.PREVIEW === "true") {
11-
adapter = staticAdapter({
12-
fallback: "index.html",
13-
});
14-
}
159

1610
/** @type {import('@sveltejs/kit').Config} */
1711
const config = {

0 commit comments

Comments
 (0)