Skip to content

Commit

Permalink
Add dockerfile and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellie Huxtable committed Nov 29, 2022
1 parent bbd521d commit 93a00c1
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Build docker image

on:
push:
branches:
- 'main'
tags:
- 'v*'

permissions:
packages: write

jobs:
build:
name: build and publish docker image
runs-on: ubuntu-latest
steps:

- name: Check Out Repo
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: ghcr.io/${{ github.repository_owner }}/metabase-clickhouse
tags: |
type=ref,event=pr
type=ref,event=branch
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
builder: ${{ steps.buildx.outputs.name }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM metabase/metabase:v0.44.6

ADD https://github.com/enqueue/metabase-clickhouse-driver/releases/download/0.7.5/clickhouse.metabase-driver.jar /plugins/

RUN chmod 744 /plugins/clickhouse.metabase-driver.jar

0 comments on commit 93a00c1

Please sign in to comment.