Skip to content

Merge pull request #276 from carverauto/updates/web_copyright #21

Merge pull request #276 from carverauto/updates/web_copyright

Merge pull request #276 from carverauto/updates/web_copyright #21

# Copyright 2025 Carver Automation Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build and Push Containers
on:
push:
branches:
- main
paths-ignore:
- '*.md'
- 'docs/**'
- '.github/**'
- '!.github/workflows/container-build.yml'
permissions:
contents: read
packages: write
jobs:
build-containers:
runs-on: ubuntu-latest
env:
VERSION: latest
BASE_REPO: ghcr.io/carverauto/serviceradar
steps:
- uses: actions/checkout@v4
- name: Extract short SHA
id: vars
run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Setup ko
uses: ko-build/[email protected]
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push container images
run: |
SHA_TAG=sha-${{ steps.vars.outputs.sha_short }}
echo "Pushing to ${{ env.BASE_REPO }}/serviceradar-agent"
cd cmd/agent
KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-agent GOFLAGS="-tags=containers" ko build \
--platform=linux/amd64 \
--tags=${SHA_TAG},latest \
--bare --verbose .
cd ../..
# Uncomment after agent works
# cd cmd/cloud
# KO_DOCKER_REPO=${{ env.BASE_REPO }}/serviceradar-cloud CGO_ENABLED=1 GOFLAGS="-tags=containers" ko build ...
# (add other components)