This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.39 KB
/
build-metabase-image.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
name: metabase-image-builder
env:
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}/nr-arch-templates
IMAGE_REGISTRY_USER: ${{ github.actor }}
IMAGE_REGISTRY_PASSWORD: ${{ github.token }}
APP_NAME: 'metabase'
on:
workflow_dispatch:
inputs:
METABASE_VERSION:
required: true
description: The metabase version to use, starts with V
default: "v0.43.1"
jobs:
build-metabase-image:
name: Build Metabase Image.
runs-on: ubuntu-22.04
defaults:
run:
working-directory: Metabase
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: check if build is required.
id: check
run: |
echo "Issue body METABASE_VERSION: ${{ github.event.issue.body.METABASE_VERSION }}"
# Check if version paramter is given.
METABASE_VERSION=${{ github.event.inputs.METABASE_VERSION }}
if [ -z $METABASE_VERSION ]
then
echo "::set-output name=build::false"
exit 0
fi
echo "::set-output name=build::true"
#
- name: Set up Docker Buildx
if: steps.check.outputs.build == 'true'
uses: docker/setup-buildx-action@v2
- name: Cache Docker layers
if: steps.check.outputs.build == 'true'
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Log in to the Container registry
if: steps.check.outputs.build == 'true'
uses: docker/login-action@v2
with:
registry: ${{ env.IMAGE_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Metabase image
if: steps.check.outputs.build == 'true'
uses: docker/build-push-action@v2
with:
push: true
tags: |
"${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}:${{ github.event.inputs.METABASE_VERSION }}"
"${{ env.IMAGE_REGISTRY }}/${{ env.APP_NAME }}:latest"
cache-from: type=gha
cache-to: type=gha,mode=max
file: |
./Metabase/openshift/.pipeline/Dockerfile.openshift
build-args: |
METABASE_VERSION=${{ github.event.inputs.METABASE_VERSION }}