From 07244a3782843b56ce86f820b2f44e25f663a029 Mon Sep 17 00:00:00 2001 From: Bryce Wray Date: Tue, 3 Aug 2021 09:48:57 -0500 Subject: [PATCH] Update deploy.md for Cloudflare Pages (#992) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update deploy.md for Cloudflare Pages - Adding description of how to set up an Astro site in Cloudflare Pages. - Minor grammatical fix in the “Credits” area. :-) [Sorry, I have OCD about “off of.”] * Remove sentence fragment Removing sentence fragment left behind when I was researching the Environment Variable part. :-/ * Update deploy.md (remove misplaced text) Same as before, but removing potentially misleading reference to Node version (since we explain in "Environment variables (advanced)" part how to resolve). --- docs/src/pages/guides/deploy.md | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/src/pages/guides/deploy.md b/docs/src/pages/guides/deploy.md index 261fb72691..bd12b7e50c 100644 --- a/docs/src/pages/guides/deploy.md +++ b/docs/src/pages/guides/deploy.md @@ -312,6 +312,24 @@ Follow the wizard started by the extension to give your app a name, choose a fra The action will work to deploy your app (watch its progress in your repo's Actions tab) and, when successfully completed, you can view your app in the address provided in the extension's progress window by clicking the 'Browse Website' button that appears when the GitHub action has run. +## Cloudflare Pages + +You can deploy your Astro project on [Cloudflare Pages](https://pages.cloudflare.com). You need: + +- A Cloudflare account. If you don”t already have one, you can create a free Cloudflare account during the process. +- Your app code pushed to a [GitHub](https://github.com) repository. + +Then, set up a new project on Cloudflare Pages. + +Use the following build settings: + +- **Framework preset**: `None` (As of this writing, Astro is not listed.) +- **Build command:** `astro build` or `npm run build` +- **Build output directory:** `dist` +- **Environment variables (advanced)**: Add an environment variable with the **Variable name** of `NODE_VERSION` and a **Value** of a [Node version that’s compatible with Astro](https://docs.astro.build/installation#prerequisites), since the Cloudflare Pages default version probably won’t work. + +Then click the **Save and Deploy** button. + ## Credits -This guide was originally based off of [Vite's](https://vitejs.dev/) well-documented static deploy guide. +This guide was originally based off [Vite](https://vitejs.dev/)’s well-documented static deploy guide.