0c27982098
Build & Push Docker Image / build (push) Successful in 2m36s
Phase 1: browse power-up - faceted filters: tags + features (array containment) and min rating on listTools; new ?tags=?features=?minRating= URL params with chips - global Cmd+K command palette (cmdk) with tool search + navigation - mini usefulness/usability bars on grid cards, wide cards and table rows
64 lines
2.1 KiB
YAML
64 lines
2.1 KiB
YAML
name: Build & Push Docker Image
|
|
run-name: Build ${{ gitea.ref_name }}
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DOCKER_HOST: tcp://172.17.0.1:2375
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Install Docker CLI
|
|
run: |
|
|
apt-get update -qq
|
|
apt-get install -y -qq docker.io
|
|
docker version
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
run: |
|
|
echo "${{ secrets.REGISTRY_TOKEN }}" | docker login git.kubebase.de -u ${{ secrets.REGISTRY_USER }} --password-stdin
|
|
|
|
- name: Build and push
|
|
run: |
|
|
SHA=$(git rev-parse --short HEAD)
|
|
FULL_SHA=$(git rev-parse HEAD)
|
|
IMAGE="git.kubebase.de/${{ gitea.repository }}"
|
|
DATE_STAMP=$(date -u +"%Y%m%d")
|
|
if [ "${{ gitea.ref_type }}" = "tag" ]; then
|
|
VERSION="${{ gitea.ref_name }}"
|
|
VERSION_TAG="${{ gitea.ref_name }}"
|
|
else
|
|
VERSION="dev-$(date -u +"%Y%m%d-%H%M")"
|
|
VERSION_TAG="nightly-${DATE_STAMP}"
|
|
fi
|
|
TAGS="-t ${IMAGE}:sha-${SHA} -t ${IMAGE}:latest -t ${IMAGE}:${VERSION_TAG}"
|
|
docker build --no-cache \
|
|
--build-arg COMMIT_SHA="$FULL_SHA" \
|
|
--build-arg BUILD_DATE="$(date -u +"%Y-%m-%dT%H:%M:%SZ")" \
|
|
--build-arg VERSION="$VERSION" \
|
|
$TAGS .
|
|
docker push "${IMAGE}:sha-${SHA}"
|
|
docker push "${IMAGE}:latest"
|
|
docker push "${IMAGE}:${VERSION_TAG}"
|
|
|
|
- name: Update k8s manifest in admin/apps
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
run: |
|
|
SHA=$(git rev-parse --short HEAD)
|
|
git clone "https://admin:${GITEA_TOKEN}@git.kubebase.de/admin/apps.git" /tmp/apps
|
|
cd /tmp/apps
|
|
cd apps/system/toolrate/overlays/k3s
|
|
sed -i "s|newTag: .*|newTag: sha-${SHA}|" kustomization.yaml
|
|
git config user.name "Gitea Actions"
|
|
git config user.email "actions@git.kubebase.de"
|
|
git add -A
|
|
git diff --cached --quiet || git commit -m "chore: update toolrate image to sha-${SHA}"
|
|
git push
|