0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Update deploy.md for Cloudflare Pages (#992)

* 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).
This commit is contained in:
Bryce Wray 2021-08-03 09:48:57 -05:00 committed by GitHub
parent 8464a441f1
commit 07244a3782
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 thats compatible with Astro](https://docs.astro.build/installation#prerequisites), since the Cloudflare Pages default version probably wont 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.