Skip to content

Commit ae790ec

Browse files
committed
ci: added website deploy scripts
1 parent 98aca9a commit ae790ec

File tree

12 files changed

+1245
-565
lines changed

12 files changed

+1245
-565
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { cloudflarePagesAdapter } from '@builder.io/qwik-city/adapters/cloudflare-pages/vite';
2+
import { extendConfig } from '@builder.io/qwik-city/vite';
3+
import baseConfig from '../../vite.config';
4+
5+
export default extendConfig(baseConfig, () => {
6+
return {
7+
build: {
8+
ssr: true,
9+
rollupOptions: {
10+
input: [
11+
'apps/website/src/entry.cloudflare-pages.tsx',
12+
'@qwik-city-plan',
13+
],
14+
},
15+
},
16+
plugins: [cloudflarePagesAdapter({})],
17+
};
18+
});

apps/website/functions/[[path]].ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// eslint-disable-next-line
2+
// @ts-ignore
3+
4+
// Cloudflare Pages Functions
5+
// https://developers.cloudflare.com/pages/platform/functions/
6+
export { onRequest } from '../../../dist/apps/website/server/entry.cloudflare-pages';

apps/website/project.json

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"outputPath": "dist/apps/website"
1212
},
1313
"configurations": {
14-
"preview": {}
14+
"preview": {},
15+
"production": {}
1516
}
1617
},
1718
"preview": {
@@ -52,6 +53,9 @@
5253
"preview": {
5354
"ssr": "src/entry.preview.tsx",
5455
"mode": "production"
56+
},
57+
"production": {
58+
"configFile": "apps/website/adapters/cloudflare-pages/vite.config.ts"
5559
}
5660
},
5761
"dependsOn": []
@@ -62,6 +66,28 @@
6266
"command": "node --inspect-brk ../..//node_modules/vite/bin/vite.js --mode ssr --force",
6367
"cwd": "apps/website"
6468
}
69+
},
70+
"deploy": {
71+
"executor": "@k11r/nx-cloudflare-wrangler:deploy-page",
72+
"options": {
73+
"dist": "dist/apps/website/client",
74+
"branch": "main",
75+
"projectName": "qwik-ui"
76+
},
77+
"dependsOn": ["build-cloudflare"]
78+
},
79+
"preview-cloudflare": {
80+
"executor": "@k11r/nx-cloudflare-wrangler:serve-page",
81+
"options": {
82+
"dist": "dist/apps/website/client"
83+
},
84+
"dependsOn": ["build-cloudflare"]
85+
},
86+
"build-cloudflare": {
87+
"executor": "nx:run-commands",
88+
"options": {
89+
"command": "npx nx run website:build:production"
90+
}
6591
}
6692
},
6793
"tags": []

apps/website/public/_headers

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# https://developers.cloudflare.com/pages/platform/headers/
2+
3+
/build/*
4+
Cache-Control: public, max-age=31536000, s-maxage=31536000, immutable

apps/website/public/_redirects

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# https://developers.cloudflare.com/pages/platform/redirects/
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/*
2+
* WHAT IS THIS FILE?
3+
*
4+
* It's the entry point for cloudflare-pages when building for production.
5+
*
6+
* Learn more about the cloudflare integration here:
7+
* - https://qwik.builder.io/integrations/deployments/cloudflare-pages/
8+
*
9+
*/
10+
import { createQwikCity } from '@builder.io/qwik-city/middleware/cloudflare-pages';
11+
import qwikCityPlan from '@qwik-city-plan';
12+
import render from './entry.ssr';
13+
14+
const onRequest = createQwikCity({ render, qwikCityPlan });
15+
16+
export { onRequest };

apps/website/src/routes/docs/headless/(components)/popover/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { component$, useSignal } from '@builder.io/qwik';
22
import { Popover, PopoverContent, PopoverTrigger } from '@qwik-ui/headless';
33
import { Button } from '@qwik-ui/primitives';
4-
import Header from '../../../../components/header/header';
4+
import Header from '../../../../../components/header/header';
55

66
export default component$(() => {
77
const controlledPopover = useSignal<boolean>(false);

apps/website/src/routes/docs/tailwind/(components)/alert/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { $, component$ } from '@builder.io/qwik';
22
import { Alert as TailwindAlert } from '@qwik-ui/tailwind';
3-
import { GitHubIcon } from '../../../../components/icons/GitHubIcon';
3+
import { GitHubIcon } from '../../../../../components/icons/GitHubIcon';
44

55
export default component$(() => {
66
return (

apps/website/src/routes/docs/tailwind/(components)/tabs/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { component$, useSignal } from '@builder.io/qwik';
22
import { Tab, TabPanel, Tabs } from '@qwik-ui/tailwind';
3-
import { Wrapper } from '../../../../components/wrapper/wrapper';
3+
import { Wrapper } from '../../../../../components/wrapper/wrapper';
44

55
export default component$(() => {
66
const tabs = ['Tab 1', 'Tab 2', 'Tab 3'];

apps/website/src/routes/layout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { component$, Slot, useStyles$ } from '@builder.io/qwik';
2-
import { GitHubIcon } from '../components/icons/GitHubIcon';
32
import {
43
DocsNavigation,
54
LinkGroup,
@@ -22,7 +21,7 @@ export default component$(() => {
2221

2322
return (
2423
<>
25-
<Header showBottomBorder={true} showVersion={true} showDocsLink={false} />
24+
<Header showBottomBorder={true} showVersion={true} />
2625

2726
<div class="flex mt-20">
2827
<DocsNavigation linksGroups={menuItemsGroups} />

0 commit comments

Comments
 (0)