Member-only story

Deploy Angular application to Google Cloud Storage (GCP) with GZip compression

Balram Chavan
4 min readMay 1, 2022

After publishing the previous story about how to compress Angular application, and deploy it to Azure Blob Storage, I have been getting many requests/questions asking how to compress and deploy the same to Google Cloud Storage bucket.

The problem statement, background have been covered in previous story. So here I will directly jump to GCP solution. If you haven’t read it, then please do so.

Google Cloud Storage Bucket Setup

Let’s create a bucket to deploy our Angular application. We would like to make this bucket public. To do so, we will have to change the permissions.

  1. Select the target GCP bucket and go to its details.
  2. Click on “Permission” tab, and click on “Add”. In the modal box, enter allUsers in “New principals” and Storage Object Viewer in “Role”.
  3. Click on “Save”. This will make your bucket public. BE CAREFUL WHAT YOU UPLOAD IN THIS BUCKET. ANYONE CAN VIEW IT.

Build Angular app with — base-href

The important step while building an Angular application is to specify the --base-href. Because, once deployed, the GCP Bucket prefix name will be required to access the script, link and…

--

--

Balram Chavan
Balram Chavan

Written by Balram Chavan

Google Developer Expert Angular | Architect | Author | http://www.youtube.com/@angularcloud

Responses (1)