- Commit new changes, trigger
Huskyto run test andlint-stagedpre-commit - Commit successful, Trigger Github Actions on push to
masterbranch, runs onubuntu-latest - Run Lint (
ESlintto find potential bugs,Prettierfor code formatting) - Run Test (
MochaandChai) - Deploy
Dockerimage toHeroku(container has same stack [ubuntu-latest] withHerokustack) - (Optional) Run
yarn teston docker, not really needed since Github Actions CI environment is alsoubuntu-latest, same environment as Docker and Heroku
- Commit new changes, trigger
Huskyto run test andlint-stagedpre-commit - Commit successful, Trigger Github Actions on pull request to
masterbranch, runs onubuntu-latest - Run Lint (
ESlintto find potential bugs,Prettierfor code formatting) - Run Test (
MochaandChai) - Merge Pull Request
- Deploy
Dockerimage toHeroku(container has same stack [ubuntu-latest] withHerokustack) - (Optional) Run
yarn teston docker, not really needed since Github Actions CI environment is alsoubuntu-latest, same environment as Docker and Heroku
Note: If dev branch, use Dev Dockerfile and push to Dev Heroku app in project pipeline, if prod use otherwise.
Huskygit hooks to specify scripts that run on events e.g pre-commit, post-commitLint-stagedonly lint staged files that is to be commited, because linting all files could be slowESlintfind potential bug in codePrettiercode formatting issueMochaframework that allows async testing, test coverage report and assertionChaiBDD/TDD assertion libraryGithub Actionsscripts to specify CI/CD process in this repoHerokudeploymentDockerhttps://www.microfocus.com/documentation/enterprise-developer/ed40pu5/ETS-help/GUID-F5BDACC7-6F0E-4EBB-9F62-E0046D8CCF1B.html
https://github.com/typicode/husky https://www.freecodecamp.org/news/how-to-add-commit-hooks-to-git-with-husky-to-automate-code-tasks/
https://github.com/okonet/lint-staged
https://github.com/prettier/eslint-config-prettier https://prettier.io/docs/en/integrating-with-linters.html https://prettier.io/docs/en/comparison.html
https://itnext.io/how-to-make-tests-using-chai-and-mocha-e9db7d8d48bc
https://dev.to/michaelcurrin/intro-tutorial-to-ci-cd-with-github-actions-2ba8 https://stackoverflow.com/questions/63220262/github-workflow-one-job-for-each-different-git-actions-push-on-master-push-t https://stackoverflow.com/questions/67257142/run-github-action-when-pushing-to-a-certain-branch
https://devcenter.heroku.com/articles/procfile#procfile-and-heroku-yml
set stack as container: heroku stack:set container --app express-boilerplate-ci-cd
dev app logs: heroku logs --app=express-boilerplate-dev
prod app logs: heroku logs --app=express-boilerplate-prod
https://stackoverflow.com/questions/52630404/how-to-install-packages-based-on-the-lock-file-with-yarn
https://stackoverflow.com/questions/30256386/how-to-copy-multiple-files-in-one-layer-using-a-dockerfile
https://stackoverflow.com/questions/42040317/cannot-find-module-for-a-node-js-app-running-in-a-docker-compose-environment
https://stackoverflow.com/questions/46440909/how-to-configure-different-dockerfile-for-development-and-production
https://youtu.be/4axmcEZTE7M