name: Build and Test

on:
  push:
    branches-ignore: 
      - master

jobs:
  build:
    runs-on: ubuntu-latest

    strategy:
      matrix:
        node-version: [10.x]

    steps:
      - uses: actions/checkout@master
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v1
        with:
          node-version: ${{ matrix.node-version }}
      - run: npm ci
      - run: npm run minify-input-css
      - run: npm run uglifyjs-index-js
      - run: npm run uglifyjs-configuration-js
      - run: npm run uglifyjs-libraries-js
      - run: npm run uglifyjs-recommended-js
      - run: npm run uglifyjs-common-js
      - run: npm run uglifyjs-payload-js
      - run: npm run uglifyjs-mislabeled-js
      - name: Set up JDK 11
        uses: actions/setup-java@v1
        with:
          java-version: 11.0.7
      - name: Build with Maven
        run: mvn clean install spotbugs:check --file pom.xml
      - name: Build Docker
        run: docker build -f Dockerfile -t housewrecker/gaps:latest .
