Code Monkey home page Code Monkey logo

my-site's Introduction

thomasduffy.io

This repo contains everything behind my personal website in code! It's a static website hosted on GCP's Cloud Storage using infrastructure provisioned on GCP by Terraform and static assets which I wrote myself.

Steps

This guide, serves as a decent high level walkthrough of the setup (which they do manually).

Terraform

Terraform is a super useful framework developed by HashiCorp which provides a declarative language (HCL) and accompanying cli terraform to manage your infrastructure like code (Infrastructure-as-Code / IaC). All you have to do is specify the infrastructure you want to provision (using the provider modules), and BOOM you've got infrastructure! And you don't have to remember all the steps to put your system in a working state.

The module to specify the infrastructure is contained within terraform/gcp. It provisions a managed zone for DNS, load balancers with redirect rules for HTTP -> HTTPS, and the Storage bucket containing the static assets that are the website itself.

<< TODO: tidbits like service account IAM, account.json file, SSL cert in beta, how to integrate with Google domains >>

GitHub Actions

GitHub Actions is essentially a CI/CD pipeline built into GitHub. The nice thing is it's free for a public repository!

With this, it's easy once our infrastructure is setup to just keep committing to this repo and our site will be updated automatically! GCP has their own actions that we make use of here to sync our assets in this repo with the Storage Bucket on GCP.

Here we've made use of the following secrets that you can add to a GitHub repository:

  • GCP_PROJECT_ID: The project id where your infrastructure lives on GCP.
  • GCP_SA_KEY: This is your account.json file in base64 encoding.
  • GCS_BUCKET: The name of the bucket you provisioned (should be equivalent to your site's URL)

Frontend

The static assets (e.g. the HTML pages and CSS configuration) live within site/public. The beauty of the storage bucket approach is we can just place our assets in the bucket and they will get served by GCP as the "website" upon request. So, for now, we've just hand-written the HTML files to get this baby in the air.

my-site's People

Contributors

tduffy000 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.