Skip to content

Added support for on-prem synthetic monitoring (#185) #77

Added support for on-prem synthetic monitoring (#185)

Added support for on-prem synthetic monitoring (#185) #77

name: Kube Agent - Docker
on:
workflow_dispatch:
inputs:
tag:
description: 'Tag for Docker image'
required: true
push:
paths-ignore:
- '.github/**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
jobs:
push_to_docker_registry:
name: Build & Push Docker Image for K8s Agent
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
token: ${{ secrets.GHCR_TOKEN }}
ssh-key: ${{ secrets.CHECK_AGENT_ACCESS }}
submodules: 'recursive'
- name: Set up GOPRIVATE
run: echo "GOPRIVATE=your.private.repo" >> $GITHUB_ENV
- name: Caching Go Modules and Build Cache
uses: actions/cache@v3
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }} # Consists Github Personal Access Token
- name: Extract Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ghcr.io/middleware-labs/mw-kube-agent
- name: Setting Release Number
run: |
if [ -n "${{ github.event.inputs.release_version }}" ]; then
echo "RELEASE_VERSION=${{ github.event.inputs.release_version }}" >> $GITHUB_ENV
else
echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
fi
- name: Build and Push
uses: docker/build-push-action@v3
with:
context: ./
file: Dockerfiles/DockerfileKube
push: true
platforms: linux/amd64,linux/arm64
build-args: |
AGENT_VERSION=${{ env.RELEASE_VERSION }}
GITHUB_TOKEN=${{ secrets.GHCR_TOKEN }}
tags: |
ghcr.io/middleware-labs/mw-kube-agent:${{ env.RELEASE_VERSION }}
ghcr.io/middleware-labs/agent-kube-go:${{ env.RELEASE_VERSION }}