Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circleci project setup #95

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
77 changes: 15 additions & 62 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,64 +1,17 @@
version: 2.1
orbs:
node: circleci/[email protected]
heroku: circleci/[email protected]

jobs:
build_and_test:
docker:
- image: cimg/node:17.2.0
steps:
- checkout
- node/install-packages:
pkg-manager: yarn
- run:
command: yarn test
name: Run tests
- run:
command: yarn build
name: Build app
- persist_to_workspace:
root: ~/project
paths:
- .
deploy: # this can be any name you choose
docker:
- image: cimg/node:17.2.0
steps:
- attach_workspace:
at: ~/project
- heroku/deploy-via-git:
force: true # force push when pushing to the heroku remote, see: https://devcenter.heroku.com/articles/git

workflows:
on_commit:
jobs:
- build_and_test
# Follow instructions here to authenticate git for Heroku: https://devcenter.heroku.com/articles/git#http-git-authentication
# The following code may be uncommented, onnce HEROKU_API_KEY & HEROKU_APP_NAME environemnt variables are present
# Read more: https://circleci.com/docs/2.0/env-vars/
# - deploy:
# requires:
# - build_and_test # only deploy if the build_and_test job has completed
# filters:
# branches:
# only: master # only deploy when on main/master
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
workflow:
test-deploy:
jobs:
- build_and_test
# Follow instructions here to authenticate git for Heroku: https://devcenter.heroku.com/articles/git#http-git-authentication
# The following code may be uncommented, onnce HEROKU_API_KEY & HEROKU_APP_NAME environemnt variables are present
# Read more: https://circleci.com/docs/2.0/env-vars/
# - deploy:
# requires:
# - build_and_test # only deploy if the build_and_test job has completed
# filters:
# branches:
# only: master # only deploy when on main/master
-test
jobs:
test:
docker:
- image: cimg/node:19.0.0
steps:
- checkout
- run:
name: install dependencies
command: npm install
- run:
name: run Tests
command: npm run test