Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/configuration-reference

# For a detailed guide to building and testing with Node, read the docs:
# https://circleci.com/docs/language-javascript/ for more details
version: 2.1

# Orbs are reusable packages of CircleCI configuration that you may share across projects, enabling you to create encapsulated, parameterized commands, jobs, and executors that can be used across multiple projects.
# See: https://circleci.com/docs/orb-intro/
orbs:
# See the Node orb documentation here: https://circleci.com/developer/orbs/orb/circleci/node
node: circleci/node@5.2

jobs:
# Below is the definition of your job to build and test your app, you can rename and customize it as you want.
test:
# Specify the execution environment. You can specify an image from Docker Hub or use one of our convenience images from CircleCI's Developer Hub.
# See: https://circleci.com/docs/executor-intro/ & https://circleci.com/docs/configuration-reference/#executor-job
docker:
# Specify the version you desire here
# See: https://circleci.com/developer/images/image/cimg/node
- image: cimg/node:16.20.1

# Add steps to the job
# See: https://circleci.com/docs/jobs-steps/#steps-overview & https://circleci.com/docs/configuration-reference/#steps
steps:
# Checkout the code as the first step.
- checkout
- node/install-packages:
override-ci-command: npm install --legacy-peer-deps
- run:
name: Run linter
command: npm run lint
- run:
name: Run tests
command: npm run test

build:
docker:
- image: cimg/node:16.20.1
steps:
- checkout
- node/install-packages:
override-ci-command: npm install --legacy-peer-deps
- run:
name: Build app
command: npm run build
- persist_to_workspace:
root: out
paths:
- .

deploy:
docker:
- image: cimg/node:16.20.1
steps:
- add_ssh_keys:
fingerprints:
- 'SHA256:5aE7AmvtKBZR+3Zs0AakVuWjtQ+oRAiw3k714FR/KeU'
- attach_workspace:
at: /tmp/out
- checkout
- run:
name: Deploy to GitHub Pages
command: |
git fetch
git checkout gh-pages
rm -rf ./*
mv /tmp/out/* .
touch .nojekyll
git config user.email "1903291+hex22a@users.noreply.github.com"
git config user.name "CircleCI (on behalf of Crash)"
git add .
git commit -m "CircleCI deploy to GitHub Pages"
git push -u origin gh-pages
# Orchestrate jobs using workflows
# See: https://circleci.com/docs/workflows/ & https://circleci.com/docs/configuration-reference/#workflows
workflows:
deploy-gh-pages: # This is the name of the workflow, feel free to change it to better match your workflow.
# Inside the workflow, you define the jobs you want to run.
jobs:
- test:
filters:
tags:
only: /.*/
branches:
ignore:
- gh-pages
# For running simple node tests, you could optionally use the node/test job from the orb to replicate and replace the job above in fewer lines.
# - node/test
- build:
filters:
tags:
only: /^\d+.\d+.\d+$/
branches:
ignore: /.*/
requires:
- test

- deploy:
filters:
tags:
only: /^\d+.\d+.\d+$/
branches:
ignore: /.*/
requires:
- test
- build
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["react-app", "airbnb-base"],
"extends": ["react-app", "airbnb-base", "prettier"],
"parser": "@babel/eslint-parser",
"ignorePatterns": [
"./node_modules/*"
Expand Down
19 changes: 19 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"enzyme-to-json": "^3.6.2",
"eslint": "^8.57.0",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-react-app": "^7.0.1",
"husky": "^1.3.1",
"jest-dom": "^3.5.0",
Expand Down