diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 00000000..d1a13598 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,118 @@ +# Copyright (C) 2018-present Arctic Ice Studio +# Copyright (C) 2018-present Sven Greb +# +# Project: Nord Docs +# Repository: https://github.com/arcticicestudio/nord-docs +# License: MIT + +# Configuration for Circle CI. +# +# References: +# - https://circleci.com/docs/2.0 +# - https://circleci.com/docs/2.0/circleci-images + +version: 2.1 + +commands: + build: + description: "Build a production bundle with Gatsby" + steps: + - run: + name: Build production bundle + command: npm run build:gatsby + post-process: + description: "Post-process the build" + steps: + - save-npm-cache + - store_artifacts: + path: ./build/reports + - store_artifacts: + path: ./public + - store_artifacts: + path: ./node_modules.tgz + - codecov/upload: + file: ./build/reports/coverage + pre-process: + description: "Pre-process the build" + steps: + - checkout + - print-env-info + - restore-npm-cache + - run: + name: Install dependencies + command: npm ci + print-env-info: + description: "Print build & environment information" + steps: + - run: + name: NPM and NodeJS Version Information + command: npm version + - run: + name: OS Information + command: uname -a + - run: + name: Git and Build Metadata + command: | + echo $CIRCLE_COMPARE_URL | cut -d/ -f7 + echo "Git branch: $CIRCLE_BRANCH" + echo "Git commit: $CIRCLE_SHA1" + echo "Job: $CIRCLE_JOB" + echo "Build: $CIRCLE_BUILD_NUM" + restore-npm-cache: + steps: + - restore_cache: + keys: + - v1-npm-cache--{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }} + - v1-npm-cache--{{ arch }}-{{ .Branch }} + - v1-npm-cache--{{ arch }} + save-npm-cache: + steps: + - save_cache: + key: v1-npm-cache--{{ arch }}-{{ .Branch }}-{{ checksum "package-lock.json" }} + paths: + - node_modules + test: + steps: + - run: + name: Lint + command: npm run lint + - run: + name: Run tests with coverage + command: npm run test:cov + +jobs: + nodejs-v8: + docker: + - image: node:8 + steps: + - pre-process + - test + - build + - post-process + nodejs-v10: + docker: + - image: node:10 + steps: + - pre-process + - test + - build + - post-process + nodejs-latest: + docker: + - image: node:latest + steps: + - pre-process + - test + - build + - post-process + +orbs: + codecov: codecov/codecov@1.0.1 + +workflows: + version: 2.1 + build-multi-version: + jobs: + - nodejs-v8 + - nodejs-v10 + - nodejs-latest diff --git a/content/blog/.gitkeep b/content/blog/.gitkeep new file mode 100644 index 00000000..1cdc14de --- /dev/null +++ b/content/blog/.gitkeep @@ -0,0 +1 @@ +A stub to prevent the "gatsby-source-filesystem" plugin to error on CI builds when this folder doesn't exist. diff --git a/content/docs/.gitkeep b/content/docs/.gitkeep new file mode 100644 index 00000000..1cdc14de --- /dev/null +++ b/content/docs/.gitkeep @@ -0,0 +1 @@ +A stub to prevent the "gatsby-source-filesystem" plugin to error on CI builds when this folder doesn't exist. diff --git a/src/assets/images/.gitkeep b/src/assets/images/.gitkeep new file mode 100644 index 00000000..1cdc14de --- /dev/null +++ b/src/assets/images/.gitkeep @@ -0,0 +1 @@ +A stub to prevent the "gatsby-source-filesystem" plugin to error on CI builds when this folder doesn't exist.