Skip to content

TheYorkshireDev/theyorkshire-dot-dev

Repository files navigation

Logo

TheYorkshire.Dev

The second iteration of theyorkshire.dev built with Gatsby and hosted with Netlify

React Version Gatsby Version Azure Pipeline Status Netlify Status

Logo

🛠 Installation & Set Up

  1. Install the Gatsby CLI

    npm install -g gatsby-cli
  2. Install dependencies

    npm install
  3. Start the development server

    npm run develop

🚀 Building and Running for Production

  1. Generate a full static production build

    npm run build
  2. Preview the site as it will appear once deployed

    npm run serve

NOTE: Google Analytics token should be set as an environment variable in your CI as ga_token. The token is picked up at build from node process.env.

⚙️ My CI/CD Setup

I am using Azure DevOps to build and deploy this website. Depending on the branch a change occurs CD is setup to deploy to either a production Netlify environment or a staging Azure environment.

I have several variables setup in Azure DevOps:

Required for Google Analytics

  • ga_token

Required to deploy to staging

  • cdn_endpoint
  • cdn_profile
  • cdn_resource_group
  • storage_account_name

Required to deploy to production

  • NETLIFY_AUTH_TOKEN
  • NETLIFY_SITE_ID

📝 Planned Enhancements

  • Pull blog posts into a second repository
  • Blog post comments
  • Blog Pagination
  • Blog PWA Notifications
  • Ability to subscribe to the blog
  • Switch CI/CD to GitHub Workflows
  • Configure the website to use CSP and other HTTP headers
  • Update staging site to use either Netlify or Azure Static Web Apps