name: ovn-docker-images

on:
  push:
  pull_request:
    branches: [ master ]
    paths: [ "dist/images/Dockerfile*"]

env:
  GO_VERSION: 1.16.3

jobs:
  build:
    name: Build Images
    runs-on: ubuntu-latest
    steps:
    - name: Set up Go
      uses: actions/setup-go@v1
      with:
        go-version: ${{ env.GO_VERSION }}
      id: go

    - name: Check out code into the Go module directory
      uses: actions/checkout@v2

    - name: Set up environment
      run: |
        export GOPATH=$(go env GOPATH)
        echo "GOPATH=$GOPATH" >> $GITHUB_ENV
        echo "$GOPATH/bin" >> $GITHUB_PATH

    - name: Build images
      run: |
        make -C dist/images all
