/semaphore-demo-static-website

A demo CI/CD pipeline for a static website with Semaphore and AWS S3 or Netlify.

Primary LanguageJavaScriptMIT LicenseMIT

Semaphore demo CI/CD pipeline using Gatsby.js

Example application and CI/CD pipeline showing how to deploy a static website to S3 and Netlify on Semaphore 2.0.

In this demo we're using Gatsby.js blog. We're starting from the Gatsby starter blog template.

CI/CD on Semaphore

Fork this repository and use it to create a project.

Populate each secret as shown in ./.semaphore/secrets/*.sample.yml

The CI pipeline will look like this:

CI pipeline on Semaphore

The example pipeline contains 2 blocks and 2 promotions:

  • Install Dependencies
    • installs and caches all npm dependencies.
  • Build site
    • Runs npm build.
    • Stores website files of "public" in cache.

If all steps are ok, we move to the deployment pipelines. It consists of two promotions:

  • Deploy to S3:
    • Deploys website files to S3 bucket which is specified in secret.
  • Deploy to Netlify
    • Deploys website files to Netlify site.

Local project setup

npm install
npm run start
npm run nightwatch

Related links

For a full step-by-step guide, read the article on dev.to.

License

Copyright (c) 2019 Rendered Text

Distributed under the MIT License. See the file LICENSE.md.