matrix:
  include:
    - language: java
      jdk: oraclejdk8
      install:
        - true # Skip build with tests
      script:
        - ./gradlew build -x test
    - language: node_js
      node_js:
        - "8.0.0"
      before_install:
        - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.1
        - export PATH=$HOME/.yarn/bin:$PATH
      cache:
        yarn: true
      script:
        - cd web
        - yarn install
        - yarn build
      deploy:
        provider: s3
        access_key_id: $AWS_ACCESS_KEY
        secret_access_key: $AWS_SECRET_ACCESS_KEY
        bucket: dungeons.and.dragons
        skip_cleanup: true
        region: us-east-1
        acl: public_read
        local_dir: build

matrix:
  include:
    - language: java
      jdk: oraclejdk8
      sudo: required # for docker only
      services:
        - docker
      install:
        - true # Skip build with tests
      script:
        - ./gradlew build -x test
      deploy:
        provider: script
        script:
          - cd api
          - docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
          - docker build -t lehasvv2009/dnd-api:latest .
          - docker push lehasvv2009/dnd-api:latest
    - language: node_js
      node_js:
        - "8.0.0"
      before_install:
        - curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.2.1
        - export PATH=$HOME/.yarn/bin:$PATH
      cache:
        yarn: true
      script:
        - cd web
        - yarn install
        - yarn build
      deploy:
        provider: s3
        access_key_id: $AWS_ACCESS_KEY
        secret_access_key: $AWS_SECRET_ACCESS_KEY
        bucket: dungeons.and.dragons
        skip_cleanup: true
        region: us-east-1
        acl: public_read
        local_dir: build

Build and push api docker image to docker hub
Build and push api docker image to docker hub
