Gatsby Up & Running: Creating a CD Pipeline

Gatsby Up & Running: Creating a CD Pipeline

My last adventure was migrating my crufty Jekyll site to Gatsby. I used to deploy my Jekyll site manually by building it locally and pushing the generated static content to the gh-pages branch on GitHub. With my new site in place, I decided it was time to leave my old ways behind and set up an automated pipeline to deploy my site to GitHub pages.

My last adventure was migrating my crufty Jekyll site to Gatsby. I used to deploy my Jekyll site manually by building it locally and pushing the generated static content to the gh-pages branch on GitHub. With my new site in place, I decided it was time to leave my old ways behind and set up an automated pipeline to deploy my site to GitHub pages.

Why GitHub Pages?

I’ve always used GitHub Pages to host my blog because it’s lightweight and integrates seamlessly with GitHub. It is simple, free, and provides free goodies like enforcing HTTPS by default and also supports adding a custom domain.

Deploying a Gatsby Site Locally

Before automating the deployment of my new Gatsby site, I learned how to deploy it locally. To do this, I added an entry to the scripts tag in package.json which creates a production-ready build for my Gatsby site.

"scripts": { 
  ...
  "build": "gatsby build"
}

npm run build builds the site and places the generated assets in a folder called public. Copying this public folder to any HTTP server would deploy my site to that server.

I started an HTTP server using http-server to serve the assets in the public folder which effectively deployed my site locally.

➜  cd public
➜  http-server

Starting up http-server, serving ./
Available on:  
http://127.0.0.1:8082  
http://10.10.10.10:8082 

travis-ci gatsbyjs devops continuous-integration javascript

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Measuring DevOps Metrics: A How-To Guide

DevOps is supposed to help streamline the process of taking code changes and getting them to production for users to enjoy. But what exactly does it mean for the process to be "streamlined"? One way to answer this is to start measuring metrics.

DevOps Rewind - 3 | What is Continuous Integration | DevOps Tutorial | DevOps Training

🔥Edureka DevOps Training: https://www.edureka.co/devops-certification-training This Edureka video on Continuous Integration explains the concept of Continuou

What is DevOps & CI/CD? A brief overview of DevOps and Continuous Integration, Continuous Deployment

So lets chat DevOps, CI/CD and software lifecycles. In this tutorial I attempt to explain DevOps and CI/CD, Continuous Integration and Continuous Delivery / Continuous Deployment. I touch on the many definitions of DevOps, I try and differentiate between DevOps and CI/CD and give you an insight into the idea of a pipeline for develop and deployment automation.

Travis CI vs Jenkins: Which CI/CD Tool Is Right For You?

The ultimate showdown between Travis CI vs Jenkins. Check out this guide to know who wins the race! Travis CI and Jenkins are both popular CI/CD tools and were launched in the same year i.e. 2011. As of July 2020, Jenkins has been the more obvious choice as CI/CD tool with 15.9k stars & 6.3k forks, in comparison to TravisCI which has 8k stars & 756 forks. However, these numbers alone don’t imply which CI/CD tool is more suitable for your upcoming or existing project. Jenkins is an open-source & Travis CI is free for open-source projects.

Setting up Continuous Integration(CI) for Node app with Travis-CI

After setting up CI with Travis-CI for a Github repository when you push your code to the repository, Travis CI clones it to build and tests your code. If one or more of those tasks fail, the build is considered broken. If none of the tasks fails, the build is considered passed. A new VM is used for every build. In this tutorial, you'll see Setting up Continuous Integration(CI) for Node app with Travis-CI