Skip to content
Snippets Groups Projects
.travis.yml 1.83 KiB
Newer Older
  • Learn to ignore specific revisions
  • Ray Schamp's avatar
    Ray Schamp committed
    language: node_js
    
    rschamp's avatar
    rschamp committed
    dist: xenial
    
    addons:
        chrome: stable
    
    Ray Schamp's avatar
    Ray Schamp committed
    node_js:
    
      global:
    
      - CHROMEDRIVER_VERSION=LATEST
    
      - NODE_ENV=production
    
      - NODE_OPTIONS=--max-old-space-size=7250
    
    Paul Kaplan's avatar
    Paul Kaplan committed
      - RELEASE_VERSION="0.1.0-prerelease.$(date +'%Y%m%d%H%M%S')"
    
    Ray Schamp's avatar
    Ray Schamp committed
    cache:
      directories:
      - node_modules
    
    - npm --production=false install
    
    - >
      if [ -z "$BEFORE_DEPLOY_RAN" ]; then
    
    Paul Kaplan's avatar
    Paul Kaplan committed
        npm --no-git-tag-version version $RELEASE_VERSION
    
        if [ "$TRAVIS_BRANCH" == "master" ]; then export NPM_TAG=stable; fi
    
        if [[ "$TRAVIS_BRANCH" == hotfix/* ]]; then export NPM_TAG=hotfix; fi # double brackets are important for matching the wildcard
    
        git config --global user.email $(git log --pretty=format:"%ae" -n1)
        git config --global user.name $(git log --pretty=format:"%an" -n1)
        export BEFORE_DEPLOY_RAN=true
      fi
    
    Ray Schamp's avatar
    Ray Schamp committed
    - provider: npm
      on:
    
        branch:
        - master
        - develop
    
        condition: $TRAVIS_EVENT_TYPE != cron
    
    Ray Schamp's avatar
    Ray Schamp committed
      skip_cleanup: true
      email: $NPM_EMAIL
      api_key: $NPM_TOKEN
    
    Paul Kaplan's avatar
    Paul Kaplan committed
    - provider: script
      on:
        branch:
        - master
        - develop
        - smoke
    
    Paul Kaplan's avatar
    Paul Kaplan committed
        condition: $TRAVIS_EVENT_TYPE != cron
      skip_cleanup: true
      script: if npm info scratch-gui | grep -q $RELEASE_VERSION; then git tag $RELEASE_VERSION && git push https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git $RELEASE_VERSION; fi
    
    - provider: script
      on:
        all_branches: true
    
        condition: $TRAVIS_EVENT_TYPE != cron && ! $TRAVIS_BRANCH =~ ^dependabot/
    
    rschamp's avatar
    rschamp committed
        tags: false # Don't push tags to gh-pages
    
      skip_cleanup: true
      script: npm run deploy -- -x -e $TRAVIS_BRANCH -r https://${GH_TOKEN}@github.com/${TRAVIS_REPO_SLUG}.git
    
    - provider: script
      on:
        branch: develop
        condition: $TRAVIS_EVENT_TYPE == cron
      skip_cleanup: true
      script: npm run i18n:src && npm run i18n:push