Skip to content

0.4.0

0.4.0 #3

Workflow file for this run

name: Docker
on:
workflow_dispatch:
release:
types: ["published"]
tags: ["[0-9]+.*"]
workflow_call:
inputs:
dockerhub_repo:
description: Docker Hub repository
default: 'puckpuck/otelcol-custom'
required: false
type: string
ghcr_repo:
description: GHCR repository
default: 'ghcr.io/puckpuck/opentelemetry-collector-extras/otelcol-custom'
required: false
type: string
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Set up BuildKit Docker container builder to be able to build
# multi-platform images and export cache
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# Login to Docker Hub and GitHub Container Registry
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Docker metadata
id: docker_metatdata
uses: docker/metadata-action@v3
with:
images: |
ghcr.io/${{ github.repository }}/otelcol-custom
puckpuck/otelcol-custom
tags: |
type=raw,value=${{ github.ref_name }}
type=raw,value=latest
# Build and push Docker image with Buildx (don't push on PR)
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/arm64,linux/amd64
push: true
tags: ${{ steps.docker_metatdata.outputs.tags }}
cache-from: type=gha
cache-to: type=gha