Skip to content

Commit

Permalink
ci(web): 🔧 change web to cf pages
Browse files Browse the repository at this point in the history
  • Loading branch information
willin committed Dec 28, 2023
1 parent cf4282e commit 6eb85fa
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 27 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ jobs:
# SESSION_KEY: ${{ secrets.SESSION_KEY }}
# GITHUB_CALLBACK_URL: ${{ secrets.GITHUB_CALLBACK_URL }}

- name: Deploy Website
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CF_API_TOKEN }}
command: deploy --config apps/website/wrangler.toml
env:
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
# - name: Deploy Website
# uses: cloudflare/wrangler-action@v3
# with:
# apiToken: ${{ secrets.CF_API_TOKEN }}
# command: deploy --config apps/website/wrangler.toml
# env:
# CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ yarn-debug.log*
yarn-error.log*

# local env files
.env
.env.local
.env.development.local
.env.test.local
Expand Down
3 changes: 2 additions & 1 deletion apps/sso/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ main = "src/index.ts"

vars = { ENVIRONMENT = "production" }
routes = [
# { pattern = "sso.willin.wang/auth/*", zone_name = "willin.wang" },
{ pattern = "sso.willin.wang/auth/*", zone_name = "willin.wang" },
{ pattern = "sso.js.cool/auth/*", zone_name = "js.cool" },
{ pattern = "sso.v0.md/auth/*", zone_name = "v0.md" }
]
kv_namespaces= [
Expand Down
4 changes: 1 addition & 3 deletions apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"scripts": {
"dev": "vite dev",
"build": "vite build",
"dev:cloudflare": "wrangler dev --config wrangler.toml",
"deploy": "wrangler deploy --config wrangler.toml",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
Expand All @@ -19,7 +17,7 @@
"zod": "^3.22.4"
},
"devDependencies": {
"@sveltejs/adapter-cloudflare-workers": "^2.0.1",
"@sveltejs/adapter-cloudflare": "^3.0.1",
"@sveltejs/kit": "^2.0.6",
"@sveltejs/vite-plugin-svelte": "^3.0.1",
"@tailwindcss/typography": "^0.5.10",
Expand Down
19 changes: 17 additions & 2 deletions apps/website/svelte.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import adapter from '@sveltejs/adapter-cloudflare-workers';
import adapter from '@sveltejs/adapter-cloudflare';
import { vitePreprocess } from '@sveltejs/vite-plugin-svelte';

/** @type {import('@sveltejs/kit').Config} */
Expand All @@ -12,7 +12,22 @@ const config = {
// If your environment is not supported or you settled on a specific environment, switch out the adapter.
// See https://kit.svelte.dev/docs/adapters for more information about adapters.
adapter: adapter({
config: './wrangler.toml'
pages: 'build',
assets: 'build',
fallback: null,
precompress: true,
routes: {
include: ['/*'],
exclude: [
'<build>',
'<prerendered>',
'/favicon.png',
'/ads.txt',
'/images',
'/auth/*',
'/api/*'
]
}
})
}
};
Expand Down
14 changes: 0 additions & 14 deletions apps/website/wrangler.toml

This file was deleted.

Binary file modified bun.lockb
Binary file not shown.

0 comments on commit 6eb85fa

Please sign in to comment.