Building Collector by @yonch #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI Collector Workflow | |
run-name: Building Collector by @${{ github.actor }} | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- feature-mem-collector-ci | |
paths: | |
- 'cmd/**' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
# - name: Login to DockerHub | |
# uses: docker/login-action@v3 | |
# with: | |
# username: ${{ vars.DOCKERHUB_USERNAME }} # Need to be set as Github variable in the repository. | |
# password: ${{ secrets.DOCKERHUB_TOKEN }} # Need to be set as Github secret in the repository. | |
- 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: ${{ inputs.container-repo }} | |
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' }} | |
push: false | |
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=<Placeholder>:cache # Need to add the repository name | |
# cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=<Placeholder>:cache,mode=max # Need to add the repository name | |