Deploy your Astro Site to Google Cloud
Google Cloud is a full-featured web app hosting platform that can be used to deploy an Astro site.
How to deploy
Section titled How to deployDeploying a project to Google Cloud requires some UI clicks. (Most of these actions can also be done using the gcloud CLI).
Cloud Run
Section titled Cloud Run-
Create a new GCP project, or select one you already have.
-
Make sure the Cloud Run API is enabled.
-
Create a new service.
-
Use a container from Docker Hub or build your own using Cloud Build.
-
Configure a port from which the files are served.
-
Enable public access by adding a new permission to
allUsers
calledCloud Run Invoker
.
Cloud Storage
Section titled Cloud Storage-
Create a new GCP project, or select one you already have.
-
Create a new bucket under Cloud Storage.
-
Give it a name and other required settings.
-
Upload your
dist
folder into it or upload using Cloud Build. -
Enable public access by adding a new permission to
allUsers
calledStorage Object Viewer
. -
Edit the website configuration and add
ìndex.html
as entrypoint and404.html
as errorpage.