name: CI
on: [push]
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v1
    - name: Cleanup to only use compose-v2 for now
      run: rm -R compose docs galaxy  test
    - name: Run shellcheck with reviewdog
      uses: reviewdog/action-shellcheck@v1.1.3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        reporter: github-check
        level: warning
        pattern: "*.sh"
    - name: Run hadolint with reviewdog
      uses: reviewdog/action-hadolint@v1
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        reporter: github-check
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Build Images (docker-compose.yml)
        continue-on-error: false
        run: docker-compose -f docker-compose.yml build
        working-directory: ./compose-v2
      # - name: Build Images (docker-compose.htcondor.yml)
      #   continue-on-error: false
      #   run: docker-compose -f docker-compose.htconder.yml build
      #   working-directory: ./compose-v2


name: CI
on: [push]
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout
      uses: actions/checkout@v1
    - name: Cleanup to only use compose-v2 for now
      run: rm -R compose docs galaxy  test
    - name: Run shellcheck with reviewdog
      uses: reviewdog/action-shellcheck@v1.1.3
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        reporter: github-check
        level: warning
        pattern: "*.sh"
    - name: Run hadolint with reviewdog
      uses: reviewdog/action-hadolint@v1
      with:
        github_token: ${{ secrets.GITHUB_TOKEN }}
        reporter: github-check
  build:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v1
      - name: Set needed environment variables
        run: export IMAGE_TAG=${GITHUB_REF##*/}
      - name: Build Images (docker-compose.yml)
        continue-on-error: false
        run: docker-compose -f docker-compose.yml build
        working-directory: ./compose-v2
      # - name: Build Images (docker-compose.htcondor.yml)
      #   continue-on-error: false
      #   run: docker-compose -f docker-compose.htconder.yml build
      #   working-directory: ./compose-v2


Define IMAGE_TAG for build step
CI: Define IMAGE_TAG for build step

By defining IMAGE_TAG as the branch name, we can later
reference images from this branch easier.
