Skip to content

telemetry block parse format #5719

telemetry block parse format

telemetry block parse format #5719

Workflow file for this run

name: Container
on:
push:
env:
ECR_REGION: us-west-2
AWS_ACCOUNT_ID: "850406765696"
jobs:
build:
name: Build ${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
strategy:
matrix:
arch: [amd64, arm64]
include:
- arch: amd64
runner: ubuntu-24.04
- arch: arm64
runner: arm-4core-linux-ubuntu24.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
with:
sparse-checkout: .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Log in to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata
uses: docker/metadata-action@318604b99e75e41977312d83839a89be02ca4893 # v5.9.0
id: meta
with:
images: ghcr.io/datadog/lading
flavor: |
suffix=-${{ matrix.arch }}
latest=false
tags: |
type=semver,pattern={{version}},event=tag
type=sha,format=long
- name: Build and push to GHCR
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
file: Dockerfile
tags: ${{ steps.meta.outputs.tags }}
push: true
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/datadog/lading:cache
cache-to: type=registry,ref=ghcr.io/datadog/lading:cache,mode=max
copy-to-ecr:
name: Copy ${{ matrix.arch }} to ECR
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
permissions:
contents: read
id-token: write # Required for OIDC authentication
steps:
- name: Log in to GitHub Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS credentials via OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/lading-container-publisher-oidc
aws-region: ${{ env.ECR_REGION }}
- name: Log in to AWS ECR
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.ECR_REGION }}.amazonaws.com
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Extract metadata
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
id: meta
with:
images: ghcr.io/datadog/lading
flavor: |
suffix=-${{ matrix.arch }}
latest=false
tags: |
type=semver,pattern={{version}},event=tag
type=sha,format=long
- name: Copy to ECR
run: |
ECR_REGISTRY="${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.ECR_REGION }}.amazonaws.com"
TAGS="${{ steps.meta.outputs.tags }}"
for GHCR_TAG in $TAGS; do
TAG_NAME="${GHCR_TAG##*:}"
ECR_TAG="${ECR_REGISTRY}/lading:${TAG_NAME}"
echo "Copying ${GHCR_TAG} to ${ECR_TAG}"
docker buildx imagetools create \
--tag "${ECR_TAG}" \
"${GHCR_TAG}"
done
manifest:
name: Create ${{ matrix.registry }} manifest
needs: [build, copy-to-ecr]
runs-on: ubuntu-latest
strategy:
matrix:
registry: [ghcr, ecr]
include:
- registry: ghcr
registry_url: ghcr.io
image_name: datadog/lading
- registry: ecr
image_name: lading
permissions:
contents: read
packages: write
id-token: write # Required for OIDC authentication
steps:
- name: Log in to GitHub Container Registry
if: matrix.registry == 'ghcr'
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Configure AWS credentials via OIDC
if: matrix.registry == 'ecr'
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/lading-container-publisher-oidc
aws-region: ${{ env.ECR_REGION }}
- name: Log in to AWS ECR
if: matrix.registry == 'ecr'
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: ${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.ECR_REGION }}.amazonaws.com
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Set registry URL
id: registry
run: |
if [ "${{ matrix.registry }}" = "ghcr" ]; then
echo "url=ghcr.io" >> "$GITHUB_OUTPUT"
else
echo "url=${{ env.AWS_ACCOUNT_ID }}.dkr.ecr.${{ env.ECR_REGION }}.amazonaws.com" >> "$GITHUB_OUTPUT"
fi
- name: Extract metadata
uses: docker/metadata-action@c1e51972afc2121e065aed6d45c65596fe445f3f # v5.8.0
id: meta
with:
images: ${{ steps.registry.outputs.url }}/${{ matrix.image_name }}
flavor: |
latest=false
tags: |
type=semver,pattern={{version}},event=tag
type=sha,format=long
- name: Create and push manifest
run: |
TAGS="${{ steps.meta.outputs.tags }}"
for TAG in $TAGS; do
echo "Creating manifest for ${TAG}"
docker buildx imagetools create \
--tag "${TAG}" \
"${TAG}-amd64" \
"${TAG}-arm64"
done