From de3b32abf1ed1e6a70472ecf9c99746c82ad10d3 Mon Sep 17 00:00:00 2001
From: Daniel Harvey <danieljamesharvey@gmail.com>
Date: Mon, 2 Oct 2023 09:23:54 +0100
Subject: [PATCH] Add docker build and push action

---
 .github/workflows/push-docker-image.yaml | 42 ++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 .github/workflows/push-docker-image.yaml

diff --git a/.github/workflows/push-docker-image.yaml b/.github/workflows/push-docker-image.yaml
new file mode 100644
index 0000000..8c9a55d
--- /dev/null
+++ b/.github/workflows/push-docker-image.yaml
@@ -0,0 +1,42 @@
+name: build and push docker image
+
+# Build and push a Docker image used by `v3-e2e-testing`.
+# This is pushed to the internal Github Container Registry.
+
+on:
+  push:
+    branches:
+      - main
+      - djh/push-docker-image-to-github-registry # remove before merge pls
+
+jobs:
+  docker:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout
+        uses: actions/checkout@v4
+
+      - name: Set up QEMU
+        uses: docker/setup-qemu-action@v3
+
+      - name: Set up Docker Buildx
+        uses: docker/setup-buildx-action@v3
+
+      - name: Login to GitHub Container Registry 📦
+        uses: docker/login-action@v3
+        with:
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
+
+      - uses: satackey/action-docker-layer-caching@v0.0.11
+        continue-on-error: true
+
+      - name: Build and push
+        uses: docker/build-push-action@v5
+        with:
+          context: .
+          platforms: linux/amd64, linux/arm64
+          push: true
+          tags: ghcr.io/hasura/ndc-clickhouse:latest, ghcr.io/hasura/ndc-clickhouse:${{ github.sha }},
+