forked from grafana/tempo
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (68 loc) · 2.26 KB
/
docker-ci-tools.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: docker-ci-tools
on:
push:
# If you define both branches/branches-ignore and paths/paths-ignore, the workflow will only run when both filters are satisfied.
branches:
- 'main'
paths:
- 'tools/**'
env:
IMAGE_NAME: grafana/tempo-ci-tools
# Needed to login to DockerHub
permissions:
contents: read
id-token: write
jobs:
get-image-tag:
if: github.repository == 'grafana/tempo' # skip in forks
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.get-tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- id: get-tag
run: |
echo "tag=$(./tools/image-tag)" >> "$GITHUB_OUTPUT"
docker-ci-tools:
if: github.repository == 'grafana/tempo'
needs: get-image-tag
strategy:
matrix:
runner_arch: [ { runner: ubuntu-24.04, arch: amd64 }, { runner: github-hosted-ubuntu-arm64, arch: arm64 } ]
runs-on: ${{ matrix.runner_arch.runner }}
env:
TAG: ${{ needs.get-image-tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: grafana/shared-workflows/actions/[email protected]
- name: docker-build-and-push
run: |
TAG_ARCH="$TAG-${{ matrix.runner_arch.arch }}"
docker build -f tools/Dockerfile -t $IMAGE_NAME:$TAG_ARCH .
docker push $IMAGE_NAME:$TAG_ARCH
manifest:
if: github.repository == 'grafana/tempo'
needs: ['get-image-tag', 'docker-ci-tools']
runs-on: ubuntu-latest
env:
TAG: ${{ needs.get-image-tag.outputs.tag }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to DockerHub
uses: grafana/shared-workflows/actions/[email protected]
- name: docker-manifest-create-and-push
run: |
docker manifest create \
$IMAGE_NAME:$TAG \
--amend $IMAGE_NAME:$TAG-amd64 \
--amend $IMAGE_NAME:$TAG-arm64
docker manifest push $IMAGE_NAME:$TAG
docker manifest create \
$IMAGE_NAME:latest \
--amend $IMAGE_NAME:$TAG-amd64 \
--amend $IMAGE_NAME:$TAG-arm64
docker manifest push $IMAGE_NAME:latest