Skip to content

Merge pull request #135 from ksysoev/dependabot/go_modules/go.opentel… #438

Merge pull request #135 from ksysoev/dependabot/go_modules/go.opentel…

Merge pull request #135 from ksysoev/dependabot/go_modules/go.opentel… #438

Workflow file for this run

name: Build Docker image
on:
push:
branches:
- main
tags:
- v*
pull_request:
permissions:
contents: read
packages: write
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}
- name: Extract version from tag
id: extract_version
run: echo "VERSION=$(echo ${{ steps.meta.outputs.tags }} | cut -d ':' -f 2)" >> $GITHUB_ENV
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ env.VERSION }}
BUILD=${{ github.sha }}