Skip to content

Building Collector by @yonch #4

Building Collector by @yonch

Building Collector by @yonch #4

Workflow file for this run

name: CI Collector Workflow
run-name: Building Collector by @${{ github.actor }}
on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'cmd/collector/**'
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Docker metadata
id: docker-metadata
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/collector
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}.{{patch}}
type=raw,value={{branch}}-{{sha}}
- name: Build and push
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker-metadata.outputs.tags }}
labels: ${{ steps.docker-metadata.outputs.labels }}
context: cmd/collector
file: cmd/collector/Dockerfile
platforms: linux/amd64,linux/arm64
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}/collector:cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=ghcr.io/${{ github.repository }}/collector:cache,mode=max