From e2ebb557689d4a1aab1fc653616a30433d408fd0 Mon Sep 17 00:00:00 2001 From: phntxx Date: Mon, 22 Nov 2021 20:55:10 +0100 Subject: [PATCH] Update CONTRIBUTING, add Docker to Pipeline --- .circleci/config.yml | 36 ++++++++++++++++++++++++++++++++++++ CONTRIBUTING.md | 9 +++++++++ 2 files changed, 45 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 3989eae..cd4ab26 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -50,9 +50,45 @@ jobs: command: | yarn coverage + build: + docker: + - image: docker:latest + steps: + - checkout + - setup_remote_docker: + version: 20.10.7 + - run: + name: Load Docker image layer cache + command: | + set +o pipefail + docker load -i /caches/app.tar | true + - run: + name: Build application Docker image + command: | + docker build --cache-from=app -t app . + - run: + name: Save Docker image layer cache + command: | + mkdir -p /caches + docker save -o /caches/app.tar app + - save_cache: + key: v1-{{ .Branch }}-{{ epoch }} + paths: + - /caches/app.tar + - deploy: + name: Push application Docker image + command: | + docker login --username ${DOCKER_USER} --password ${DOCKER_PASSWORD} + docker tag app phntxx/dashboard:latest + docker push phntxx/dashboard:latest + workflows: version: 2 dashboard: jobs: - style - dashboard + - build: + requires: + - style + - dashboard diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2874546..eb158a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,15 @@ # Contributing to this repository +Thank you for wanting to contribute to dashboard! + There are a few things to keep in mind when contributing: - We're using Prettier, so make sure to either format your code using `yarn prettier --write`, or by installing an extension for your editor to auto-format everything. - We're using the React testing library for testing and CircleCI for CI/CD. Please ensure that the tests pass with your contribution, either by adding sufficient test coverage to your contribution or by modifying existing tests for sufficient coverage (that is if your contribution modifies existing code). + +In summary, please make sure the following two commands run without issue before creating your PR: + +```sh +yarn prettier +yarn test +```