Skip to content

Commit

Permalink
Update and rename grafana-build.yml to grafana-docker.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tillsteinbach authored Aug 24, 2021
1 parent d4cf9d1 commit 1087401
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 43 deletions.
43 changes: 0 additions & 43 deletions .github/workflows/grafana-build.yml

This file was deleted.

74 changes: 74 additions & 0 deletions .github/workflows/grafana-docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# This is a basic workflow to help you get started with Actions

name: grafana Build

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ main ]
tags:
- "v*"
paths:
- .github/workflows/grafana-docker.yml
- grafana/**


# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
images: |
tillsteinbach/vwsfriend-grafana
ghcr.io/tillsteinbach/vwsfriend-grafana
tags: |
type=edge,
type=pep440,pattern={{version}}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Setup Docker Buildx
uses: docker/[email protected]
- name: Cache Docker layers
uses: actions/[email protected]
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-vwsfriend-grafana-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: grafana
push: ${{ github.event_name != 'pull_request' }}
platforms: linux/amd64,linux/arm/v7,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
# This ugly bit is necessary if you don't want your cache to grow forever
# till it hits GitHub's limit of 5GB.
# Temp fix
# https://github.com/docker/build-push-action/issues/252
# https://github.com/moby/buildkit/issues/1896
- name: Move cache
run: |
rm -rf /tmp/.buildx-cache
mv /tmp/.buildx-cache-new /tmp/.buildx-cache

0 comments on commit 1087401

Please sign in to comment.