Skip to content

Merge pull request #99 from sanderdw/metabase-1.0.0 #38

Merge pull request #99 from sanderdw/metabase-1.0.0

Merge pull request #99 from sanderdw/metabase-1.0.0 #38

Workflow file for this run

name: Metabase
# Controls when the workflow will run
on:
workflow_dispatch:
push:
branches:
- 'master'
- 'metabase-1.0.0'
tags:
- '*.*.*'
paths:
- 'metabase/Dockerfile'
- 'metabase/run.sh'
# pull_request:
# branches:
# - 'master'
# - 'develop'
jobs:
metabase:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write
steps:
# Get the repository's code
- name: Checkout
uses: actions/checkout@v4
# https://github.com/docker/setup-qemu-action
- name: Get the version from config.json
id: data
run: |
version=$(jq --raw-output '.version' ./metabase/config.json)
echo "HA_RELEASE=$version" >> "$GITHUB_OUTPUT"
- name: Metabase addon release
env:
HA_RELEASE: ${{ steps.data.outputs.HA_RELEASE }}
run: echo "$HA_RELEASE"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Log in to ghcr.io
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker meta
id: meta # you'll use this in the next step
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
sanderdw/ha-metabase
ghcr.io/${{ github.repository }}/ha-metabase
# Docker tags based on the following events/attributes
tags: |
type=schedule
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=raw,value=${{ steps.data.outputs.HA_RELEASE }}
- name: Build and push
id: push
uses: docker/build-push-action@v5
with:
context: ./metabase
# https://github.com/metabase/metabase/issues/13119#issuecomment-2539434988
# platforms: linux/amd64,linux/arm64
platforms: linux/amd64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
HA_RELEASE=${{ steps.data.outputs.HA_RELEASE }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v2
with:
subject-name: ghcr.io/${{ github.repository }}/ha-metabase
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true