language: node_js
node_js:
  - 14
dist: trusty
sudo: false

cache:
  directories:
  - node_modules

install:
  - npm install -g yarn pm2
  - yarn install

script:
  - yarn test

deploy:
  provider: script
  script: openssl aes-256-cbc -K $encrypted_0fe5067b505f_key -iv $encrypted_0fe5067b505f_iv -in ./scripts/private-key.pem.enc -out private-key.pem -d && chmod 400 private-key.pem  && pm2 deploy ecosystem.config.js production
  on:
    branch: master
    tags: true
