language: node_js
node_js:
- 14
cache:
directories:
- node_modules
jobs:
include:
- stage: Build and Test
script:
- npm install
- npm test
- stage: Deploy to Production
if: branch = main
script:
- npm install -g heroku
- heroku login -i
- heroku git:remote -a your-heroku-app-name
- git push heroku main
notifications:
slack:
rooms:
- your-slack-room
on_success: always
on_failure: always
email:
recipients:
- your-email@example.com
on_success: always
on_failure: always