From fa7f3cfcee0c95e0a050b52e9476821cf9255026 Mon Sep 17 00:00:00 2001 From: Martin Kennelly Date: Tue, 16 Feb 2021 15:45:00 +0000 Subject: [PATCH 1/2] Add github action to build docker image for PRs For each new PR, we want to build the Dockerfile using GitHub actions. --- .github/workflows/docker-build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..1748411e --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,16 @@ +name: Docker-build +on: [pull_request] +jobs: + + build: + name: Docker build + runs-on: ubuntu-latest + env: + GO111MODULE: on + TAG: network-resources-injector:latest + steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v2 + + - name: Build Dockerfile + run: docker build -f Dockerfile -t ${TAG} . From a308889ec29a53e94bde6ba959f11a70e0e48f5f Mon Sep 17 00:00:00 2001 From: "Kennelly, Martin" Date: Mon, 8 Mar 2021 13:23:16 +0000 Subject: [PATCH 2/2] Utilize docker GAs for building Signed-off-by: Kennelly, Martin --- .github/workflows/docker-build.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 1748411e..5c43bf9a 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -1,16 +1,18 @@ name: Docker-build -on: [pull_request] +on: [pull_request, push] jobs: - build: - name: Docker build runs-on: ubuntu-latest env: GO111MODULE: on - TAG: network-resources-injector:latest steps: - name: Check out code into the Go module directory uses: actions/checkout@v2 - - name: Build Dockerfile - run: docker build -f Dockerfile -t ${TAG} . + - name: Build only + uses: docker/build-push-action@v2 + with: + push: false + context: . + file: ./Dockerfile + tags: network-resources-injector:latest