Skip to content

Commit

Permalink
Add grafana images from PR
Browse files Browse the repository at this point in the history
  • Loading branch information
Julien committed Nov 15, 2023
1 parent ad6d00c commit c028a3e
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 24 deletions.
37 changes: 37 additions & 0 deletions .github/actions/grafana/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: 'Grafana'
description: 'Grafana images'
inputs:
tags:
description: 'Tags'
required: false
default: ''
labels:
description: 'Labels'
required: true
image:
description: 'Image target'
required: true
default: 'myteslamate/grafana'
runs:
using: "composite"
steps:
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ inputs.image }}
tags: ${{ inputs.tags }}
labels: ${{ inputs.labels }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/[email protected]
with:
context: grafana
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
28 changes: 6 additions & 22 deletions .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
cache_id: arm64

runs-on: ${{ matrix.runs_on }}
timeout-minutes: 10

steps:
- name: Checkout
Expand Down Expand Up @@ -75,34 +76,17 @@ jobs:
grafana:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5

- uses: ./.github/actions/grafana
with:
images: teslamate/grafana
tags: |
type=edge
type=schedule,pattern=edge
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: teslamate
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and push
uses: docker/[email protected]
with:
context: grafana
push: true
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ${{ steps.docker_meta.outputs.tags }}
cache-from: type=gha
cache-to: type=gha,mode=max
23 changes: 21 additions & 2 deletions .github/workflows/ghcr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache_id: arm
- platform: "linux/arm64"
runs_on: "buildjet-2vcpu-ubuntu-2204-arm"
cache_id: arm64
cache_id: arm64
runs-on: ${{ matrix.runs_on }}
timeout-minutes: 10
steps:
Expand Down Expand Up @@ -73,4 +73,23 @@ jobs:
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
- name: Inspect image
run: |
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(cat /tmp/teslamate/version)
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:$(cat /tmp/teslamate/version)
grafana:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: ./.github/actions/grafana
with:
image: ghcr.io/teslamate/teslamate/grafana
labels: |
org.opencontainers.image.version=${{ github.ref || github.ref_name }}

0 comments on commit c028a3e

Please sign in to comment.