Files
katenary/.gitea/workflows/build-oci.yaml
Patrice Ferlet c1bd356c7f
All checks were successful
/ build-packages (arm64, linux) (push) Successful in 1m50s
/ build-packages (amd64, darwin) (push) Successful in 1m22s
/ build-packages (amd64, freebsd) (push) Successful in 1m52s
/ build-packages (amd64, linux) (push) Successful in 1m53s
/ build-packages (amd64, windows) (push) Successful in 1m44s
/ build-packages (arm64, freebsd) (push) Successful in 1m50s
Build and push OCI image / build (push) Successful in 2m28s
Go-Tests / tests (push) Successful in 1m57s
Go-Tests / sonar (push) Successful in 45s
Enhance versionning on build packages (#165)
It was too challenging to only use "tags" without a prefix to trigger builds. So, the new rule is to prefix releases tags by "releases/"

Reviewed-on: #165
2025-08-22 08:33:32 +00:00

56 lines
1.5 KiB
YAML

name: Build and push OCI image
on:
push:
tags:
- "releases/*"
env:
REGISTRY: repo.katenary.io
IMAGE_NAME: ${{ gitea.repository }}
STORAGE_DRIVER: vfs
VERSION: ${{ gitea.ref_name }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Extract version
run: |
VERSION="${VERSION#releases/}"
echo "Exporting variable VERSION=$VERSION"
echo "VERSION=$VERSION" >> $GITEA_OUTPUT
echo "VERSION=$VERSION" >> $GITEA_ENV
- name: Install Buildah
run: |-
env
if ! command -v buildah 2>/dev/null; then
echo "Install Buildah"
sudo apt-get update
sudo apt-get install -y buildah
else
echo "Buildah already installed"
fi
- name: Login to repository
run: |
buildah login $REGISTRY -u ${{ gitea.actor }} -p ${{ secrets.ACCESS_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v4
- name: Build and tag
run: |-
echo "Building image $REGISTRY/${IMAGE_NAME,,}:$VERSION / latest"
buildah build --isolation=chroot --build-arg VERSION=$VERSION -t katenary -f ./oci/katenary/Containerfile .
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:$VERSION
buildah tag katenary $REGISTRY/${IMAGE_NAME,,}:latest
- name: Push image
run: |-
buildah push $REGISTRY/${IMAGE_NAME,,}:$VERSION
buildah push $REGISTRY/${IMAGE_NAME,,}:latest