-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Julien
committed
Nov 15, 2023
1 parent
ad6d00c
commit c028a3e
Showing
3 changed files
with
64 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ jobs: | |
cache_id: arm64 | ||
|
||
runs-on: ${{ matrix.runs_on }} | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- name: Checkout | ||
|
@@ -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 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 }} |