version: 2
jobs:
  build:
    machine: true
    resource_class: large
    branches:
      ignore:
        - gh-pages
    steps:
      - checkout
      - run:
          name: Build Docker image
          command: |
            docker pull insighttoolkit/itk-js:latest
            ./src/Docker/build.sh
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              docker login -u $DOCKER_USER -p $DOCKER_PASS
              docker push insighttoolkit/itk-js:latest
            fi
      - run:
          name: Install Node packages
          command: |
            npm install
      - run:
          name: Build
          command: |
            npm run build
      - run:
          name: Test
          command: |
            google-chrome --version
            npm run test
      - deploy:
          name: Publish docs
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              git config --global user.name "Circle CI"
              git config --global user.email "robot@itk.org"
              npm run doc:publish
            fi

version: 2
jobs:
  build:
    machine: true
    resource_class: large
    branches:
      ignore:
        - gh-pages
    steps:
      - checkout
      - run:
          name: Build Docker image
          no_output_timeout: 2.0h
          command: |
            docker pull insighttoolkit/itk-js:latest
            ./src/Docker/build.sh
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              docker login -u $DOCKER_USER -p $DOCKER_PASS
              docker push insighttoolkit/itk-js:latest
            fi
      - run:
          name: Install Node packages
          command: |
            npm install
      - run:
          name: Build
          command: |
            npm run build
      - run:
          name: Test
          command: |
            google-chrome --version
            npm run test
      - deploy:
          name: Publish docs
          command: |
            if [ "${CIRCLE_BRANCH}" == "master" ]; then
              git config --global user.name "Circle CI"
              git config --global user.email "robot@itk.org"
              npm run doc:publish
            fi

Increase Docker image build timeout
ci(CircleCI): Increase Docker image build timeout
