-
Notifications
You must be signed in to change notification settings - Fork 197
Migrate to Cloudflare #2432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate to Cloudflare #2432
Changes from 20 commits
a6ff1e2
e2f7d7a
fdec2d3
6dcfcab
dd77cab
850ca09
080e4e6
df8cac3
43c3721
d91ca95
8d71e9e
4d2e761
1865960
02eccd8
604a55e
514ade4
31dae02
d969527
2e54f5f
178477d
947d158
937517d
f3402eb
251286d
e26bd79
f8a8558
23d26b1
7f11920
35c8d3d
f0edf23
4aafcb8
0529168
1089ce1
8ee6041
cbcea5f
53fd01d
59536a1
be90647
d13a2bd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: Worker Build Logs | ||
|
|
||
| on: | ||
| push: | ||
| branches: ["**"] | ||
|
|
||
| jobs: | ||
| build-logs: | ||
| if: github.repository == 'withastro/astro.build' | ||
| name: Cloudflare Worker Build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Stream Workers Builds Logs | ||
| uses: withastro/workers-builds-log-action@v1 | ||
| with: | ||
| api-token: ${{ secrets.CF_BUILDS_API_TOKEN }} | ||
| account-id: ${{ secrets.CF_ACCOUNT_ID }} | ||
| worker-tag: ${{ secrets.CF_WORKER_TAG }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,20 +1,20 @@ | ||
| // @ts-check | ||
|
|
||
| import mdx from '@astrojs/mdx'; | ||
| import netlify from '@astrojs/netlify'; | ||
| import cloudflare from '@astrojs/cloudflare'; | ||
| import sitemap from '@astrojs/sitemap'; | ||
| import tailwind from '@astrojs/tailwind'; | ||
| import { defineConfig } from 'astro/config'; | ||
| import { defineConfig, sessionDrivers } from 'astro/config'; | ||
| import astroExpressiveCode from 'astro-expressive-code'; | ||
| import icon from 'astro-icon'; | ||
| import houston from './houston.theme.json'; | ||
|
|
||
| /* https://docs.netlify.com/configure-builds/environment-variables/#read-only-variables */ | ||
| const NETLIFY_PREVIEW_SITE = process.env.CONTEXT !== 'production' && process.env.DEPLOY_PRIME_URL; | ||
| /* On Cloudflare Workers Builds, CF_PAGES_URL is set to the preview URL for non-production deploys */ | ||
| const PREVIEW_SITE = process.env.CF_PAGES_URL; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure this is correct? In the preview deploy I’m seeing everything using
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to use WORKERS_CI_BRANCH which seems to fix it.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks good — we should check after merging to make sure this is also the value we want in prod (i.e. it should be |
||
|
|
||
| // https://astro.build/config | ||
| export default defineConfig({ | ||
| site: NETLIFY_PREVIEW_SITE || 'https://astro.build', | ||
| site: PREVIEW_SITE || 'https://astro.build', | ||
| prefetch: true, | ||
| integrations: [ | ||
| tailwind({ | ||
|
|
@@ -55,9 +55,24 @@ export default defineConfig({ | |
| vite: { | ||
| ssr: { | ||
| noExternal: ['smartypants'], | ||
| optimizeDeps: { | ||
| include: [ | ||
| 'astro-expressive-code/components', | ||
| 'astro-expressive-code > hast-util-select', | ||
| 'astro-expressive-code > rehype', | ||
| 'astro-expressive-code > unist-util-visit', | ||
| 'astro-expressive-code > rehype-format', | ||
| 'astro-expressive-code > hastscript', | ||
| 'astro-expressive-code > hast-util-from-html', | ||
| 'astro-expressive-code > hast-util-to-string', | ||
| 'astro-expressive-code > @expressive-code/core > postcss', | ||
| 'astro-icon > @iconify/utils', | ||
| ], | ||
| }, | ||
| }, | ||
| }, | ||
| adapter: netlify({ imageCDN: false }), | ||
| adapter: cloudflare({ imageService: 'compile' }), | ||
| session: { driver: sessionDrivers.lruCache() }, | ||
| experimental: { | ||
| contentIntellisense: true, | ||
| rustCompiler: true, | ||
|
|
||
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an auth step missing here? I assume not just everyone is able to put stuff in this bucket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, I added a comment about this.