text: ---
  name: Lint Docker
  
  # yamllint disable-line rule:truthy
  on:
    pull_request:
      paths-ignore:
        - '**/*.json'
        - '**/*.md'
        - '**/*.txt'
        - '.git*'
        - '.yamllint'
        - 'LICENSE'
    push:
      paths:
        - '**/*.y?ml'
        - '.github/workflows/lint-docker.yml'
        - 'Dockerfile'
  
  jobs:
    Hadolint:
      runs-on: ubuntu-latest
      steps:
        - uses: actions/checkout@v2
        - uses: brpaz/hadolint-action@master
          with:
            dockerfile: Dockerfile
    DockerCompose:
      runs-on: ubuntu-latest
      needs: Hadolint
      steps:
        - uses: actions/checkout@v1
        - name: Validates Docker Compose files
          run: |
            find . -name docker-compose.yml -print |
              while read file; do
                docker-compose -f $file config -q || exit 1
              done
  