How to Deploy Astro on Google Cloud with Bitbucket.

10/6/2023 by Jussi Nevavuori


Select your preferred workflow below.

Manual

Manual deployment using Google Cloud Console, Bitbucket Console and more.

Automatic

Automated deployment using Terraform, GCloud CLI, automation scripts and other tools.


Preface

This tutorial will show you how to deploy static Astro sites on Google Cloud. The deployment uses Google Cloud Storage, Google Cloud Load Balancer, Bitbucket pipelines and more to provide the following features:

Note: This guide does not only apply to Astro but can be applied and adapted to suit any static site deployment needs for any SSG codebase.

Project repository

Project repository available here.

This guide assumes

- This guide assumes that you are using the `main` branch. In order to use the `master` branch, you might have to change `main` to `master` in many scripts.

This guide does not include

  • Partial redeployments: Using this guide, you rebuild and redeploy your entire site on all changes. Setup for a system which only redeploys changed pages is beyond the scope of this guide and often not required.
  • Staging or other preview deployments: Using this guide, you only get a `main` branch that automatically deploys to your live site. Staging and other preview deployments are beyond the scope of this guide.
  • This guide does not support