forked from oxeye-yuval/opentelemetry-collector-contrib
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.42 KB
/
docker-build.yaml
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
---
name: Docker-Build
on:
push:
branches: [main]
tags: ["v*"]
pull_request:
branches: [main]
permissions:
id-token: write
contents: read
jobs:
docker-build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_IAM_ROLE }}
role-session-name: github-${{ github.repository_id }}-${{ github.triggering_actor }}
aws-region: ${{ secrets.AWS_REGION }}
- uses: aws-actions/amazon-ecr-login@v1
id: login-ecr
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ steps.login-ecr.outputs.registry }}/dp-otel-collector-deduplicator
tags: |
type=sha,format=long,prefix=sha-
type=ref,event=branch
type=semver,pattern=v{{version}}
type=semver,pattern=v{{major}}.{{minor}}
- name: Docker build
uses: docker/build-push-action@v3
with:
push: true
context: .
file: cmd/otelcontribcol/Dockerfile
cache-from: type=gha,scope=${{ github.ref_name }}-opentelemetry-collector
cache-to: type=gha,mode=max,scope=${{ github.ref_name }}-opentelemetry-collector
tags: ${{ steps.meta.outputs.tags }}