Skip to content

Commit 8b8febd

Browse files

File tree

6 files changed

+51
-9
lines changed

6 files changed

+51
-9
lines changed

.github/workflows/deploy.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Deploy
2+
on:
3+
push:
4+
branches: [main]
5+
pull_request:
6+
branches: main
7+
8+
jobs:
9+
deploy:
10+
name: Deploy
11+
runs-on: ubuntu-latest
12+
13+
permissions:
14+
id-token: write # Needed for auth with Deno Deploy
15+
contents: read # Needed to clone the repository
16+
17+
steps:
18+
- name: Clone repository
19+
uses: actions/checkout@v3
20+
21+
- name: Install Deno
22+
uses: denoland/setup-deno@v1
23+
24+
- name: Build step
25+
run: deno task build
26+
27+
- name: Upload to Deno Deploy
28+
uses: denoland/deployctl@v1
29+
with:
30+
project: saaskit
31+
entrypoint: ./main.ts

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
cov/
44
cov.lcov
55
.idea
6+
_fresh/

deno.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@
1111
"check:types": "deno check **/*.ts && deno check **/*.tsx",
1212
"ok": "deno fmt --check && deno lint && deno task check:license --check && deno task check:types && deno task test",
1313
"cov": "deno coverage ./cov/ --lcov --exclude='test.ts' > cov.lcov",
14-
"update": "deno run -A -r https://fresh.deno.dev/update ."
14+
"update": "deno run -A -r https://fresh.deno.dev/update .",
15+
"build": "deno run -A --unstable dev.ts build",
16+
"preview": "deno run -A --unstable main.ts"
1517
},
1618
"compilerOptions": {
1719
"jsx": "react-jsx",
1820
"jsxImportSource": "preact"
1921
},
2022
"imports": {
2123
"@/": "./",
22-
"$fresh/": "https://raw.githubusercontent.com/denoland/fresh/726740ed39aa0c5a9c484f4eba4f6e329cf730d1/",
24+
"$fresh/": "https://deno.land/x/fresh@1.4.2/",
2325
"$gfm": "https://deno.land/x/[email protected]/mod.ts",
2426
"preact": "https://esm.sh/[email protected]",
2527
"preact/": "https://esm.sh/[email protected]/",
26-
"preact-render-to-string": "https://esm.sh/*[email protected].0",
28+
"preact-render-to-string": "https://esm.sh/*[email protected].1",
2729
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
2830
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
2931
"twind-preset-tailwind/": "https://esm.sh/@twind/[email protected]/",
@@ -37,7 +39,8 @@
3739
"fresh_charts/": "https://deno.land/x/[email protected]/"
3840
},
3941
"exclude": [
40-
"cov/"
42+
"cov/",
43+
"_fresh/"
4144
],
4245
"lint": {
4346
"rules": {

dev.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
33

44
import dev from "$fresh/dev.ts";
5+
import config from "./fresh.config.ts";
56
import "std/dotenv/load.ts";
67

7-
await dev(import.meta.url, "./main.ts");
8+
await dev(import.meta.url, "./main.ts", config);

fresh.config.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright 2023 the Deno authors. All rights reserved. MIT license.
2+
import { defineConfig } from "$fresh/server.ts";
3+
import twindPlugin from "$fresh/plugins/twindv1.ts";
4+
import twindConfig from "./twind.config.ts";
5+
6+
export default defineConfig({
7+
plugins: [twindPlugin(twindConfig)],
8+
});

main.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
import { start } from "$fresh/server.ts";
1010
import manifest from "./fresh.gen.ts";
11-
12-
import twindPlugin from "$fresh/plugins/twindv1.ts";
13-
import twindConfig from "./twind.config.ts";
11+
import config from "./fresh.config.ts";
1412

1513
/**
1614
* @todo Remove at v1. This is a quick way to reset Deno KV, as database changes are likely to occur and require reset.
@@ -29,4 +27,4 @@ if (Deno.env.get("MIGRATE_DENO_KV") === "1") {
2927
await migrateKv();
3028
}
3129

32-
await start(manifest, { plugins: [twindPlugin(twindConfig)] });
30+
await start(manifest, config);

0 commit comments

Comments
 (0)