Skip to content

Merge pull request #11 from StacklokLabs/add-logo-to-readme #4

Merge pull request #11 from StacklokLabs/add-logo-to-readme

Merge pull request #11 from StacklokLabs/add-logo-to-readme #4

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
release:
name: Release Container
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: true
- name: Install Task
uses: arduino/setup-task@v2
with:
version: '3.x'
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: task install
- name: Test
run: task test
- name: Setup Ko
uses: ko-build/setup-ko@v0.9
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract tag version
id: tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Set repository owner lowercase
id: repo_owner
run: echo "OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT
- name: Build and push container
env:
KO_DOCKER_REPO: ghcr.io/${{ steps.repo_owner.outputs.OWNER }}/mkp
VERSION: ${{ steps.tag.outputs.VERSION }}
CREATION_TIME: $(date -u +'%Y-%m-%dT%H:%M:%SZ')
run: |
# Build and push the container with reproducible build flags
ko build \
--bare \
--sbom=spdx \
--platform=linux/amd64,linux/arm64 \
--base-import-paths \
--tags $VERSION,latest \
./cmd/server