Add docs for deploying using Google Cloud (#1533)

This commit is contained in:
Elian ☕️ 2021-10-12 18:35:05 +02:00 committed by GitHub
parent b21eafd35c
commit d90c0456b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -205,6 +205,38 @@ You can skip the `netlify.toml` file and go directly to [Netlify](https://netlif
- **Build Command:** `astro build` or `npm run build` - **Build Command:** `astro build` or `npm run build`
- **Publish directory:** `dist` - **Publish directory:** `dist`
## Google Cloud
different from most available deploy options here, [Google Cloud](<https://cloud.google.com>) requires some UI clicks to deploy projects. (Most of these actions can also be done using the gcloud CLI).
### Cloud Run
1. Create a new GCP project, or select one you already have
2. Make sure the Cloud Run API is enabled
3. Create a new service
4. use a container from Docker Hub or build your own using [Cloud Build](<https://cloud.google.com/build>)
5. Configure a port from which the files are served
6. Enable public access by adding a new permission to `allUsers` called `Cloud Run Invoker`
### Cloud Storage
1. Create a new GCP project, or select one you already have
2. Create a new bucket under [Cloud Storage](<https://cloud.google.com/storage>)
3. give it a name and other required settings
4. Upload your `dist` folder into it or upload using [Cloud Build](<https://cloud.google.com/build>)
5. Enable public acces by adding a new permission to `allUsers` called `Storage Object Viewer`
6. Edit the website configuration and add `ìndex.html` as entrypoint and `404.html` as errorpage
## Google Firebase ## Google Firebase
1. Make sure you have [firebase-tools](https://www.npmjs.com/package/firebase-tools) installed. 1. Make sure you have [firebase-tools](https://www.npmjs.com/package/firebase-tools) installed.