This guide explains the steps I'll recommend if you want to build your static website and set up a CI/CD pipeline for it, based on my own experience.
- Choose a template. (I got mine from StyleShout)
- Download the template and edit with your preferred IDE/ code editor (Remember to verify responsiveness. If you use VSCode, this can be helpful).
- Push to GitHub.
- Purchase your domain (I purchased mine on CloudFlare).
- Start a GCP project and create a storage bucket. (How To).
- The bucket should be named with the domain you intend to use for your website (ie. the one you purchased above).
- Follow the prompts to verify that you own this domain (through Google Search Console).
- This verification would automatically modify your domain's DNS records.
- You want uniform access control on your bucket.
- Bucket should be publicly accessible. (How To).
- Create a service account to be used by the GitHub workflow for CI/CD. (How To).
- This account should have permission to write to your GCS bucket.
- Copy the credentials and keys for this service account and save as secret in GitHub (How To).
- Include the name of your bucket in the secrets as well. (Optional)
- Write the GitHub workflow and include it in the
.github/workflows
directory. Cloud Storage Uploader - Modify your DNS records:
- Set a CNAME record for the root to point to
storage.googleapis.com
. - Set a CNAME record for
www
to point tostorage.googleapis.com
.- Now you would need to setup a page forwarding rule for
www
to forward to the root.
- Now you would need to setup a page forwarding rule for
- Set a CNAME record for the root to point to
PS: If you have any questions and/ or contributions to make to these steps, please forward such to me at: triumph@triumphurias.com