-
Notifications
You must be signed in to change notification settings - Fork 3
37 lines (32 loc) · 963 Bytes
/
docker.yml
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
# See https://docs.docker.com/build/ci/github-actions/multi-platform/
name: Build and Push Image
on:
push:
branches:
- main
tags:
- v*
permissions:
contents: read
id-token: write
env:
REGISTRY_IMAGE: grafana/cloudcost-exporter
# Docker image tags. See https://github.com/docker/metadata-action for format
TAGS_CONFIG: |
type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }}
type=sha,prefix={{ branch }}-,format=short,enable=${{ github.ref == 'refs/heads/main' }}
type=semver,pattern={{ version }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build and push
uses: grafana/shared-workflows/actions/build-push-to-dockerhub@main
with:
repository: ${{ env.REGISTRY_IMAGE }}
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ env.TAGS_CONFIG }}