language: ruby sudo: false cache: bundler rvm: - 2.3 before_install: - nvm install v12 && nvm use v12 - npm i -g npm - npm i -g firebase-tools - git clone https://jblew:${GH_TOKEN}@github.com/jblew/amerykahospital-personalizedadvice-settings.git settings - | if [[ $TRAVIS_BRANCH == "production" ]]; then firebase use production settings/scripts/select-production.sh echo "Using production environment" else firebase use preprod settings/scripts/select-preprod.sh echo "Using preprod environment" fi - npm --prefix="./settings" ci && npm --prefix="./settings" run build - npm --prefix="./public" install - npm --prefix="./roles-manager-app" ci - npm --prefix="./professional-panel" ci script: - node --version # Build public website - (cd public && bundle exec jekyll build) # Build roles manager app - npm --prefix="./roles-manager-app" run build - mv ./roles-manager-app/dist ./public/_site/role-management # Build medical professional app - npm --prefix="./professional-panel" run build - mv ./professional-panel/dist ./public/_site/professional-panel # Test links on public website - '(cd public && bundle exec htmlproofer --typhoeus-config "{ \"ssl_verifypeer\": false, \"ssl_verifyhost\": 0 }" ./_site)' branches: only: - preprod - production env: global: - NOKOGIRI_USE_SYSTEM_LIBRARIES=true # speeds up installation of html-proofer addons: apt: packages: - libcurl4-openssl-dev deploy: - provider: script script: bash -c "node --version && npx firebase deploy --only hosting" skip_cleanup: true on: tags: false all_branches: true condition: $TRAVIS_BRANCH =~ ^(preprod|production)$