2f66fff993
Build & Push Docker Image / build (push) Failing after 1m18s
Policy: every direct dependency is now an exact pin; lockfile + --frozen-lockfile keep builds reproducible; save-exact=true enforced. Toolchain: - pnpm 10.26 -> 11.18 (lockfile migrated; supportedArchitectures moved to pnpm-workspace.yaml) - typescript 5.9 -> 7.0, vite 7 -> 8, @vitejs/plugin-react 5 -> 6 - esbuild override 0.27.3 -> 0.28.1 (closes GHSA-g7r4-m6w7-qqqr); added @esbuild/darwin-arm64 for local dev - orval 8.9 -> 8.23, regenerated clients Backend (prod image): - openid-client 5.7 -> 6.8 (rewritten OIDC flow in routes/auth.ts: discovery + functional API, PKCE/state, fetchUserInfo, buildEndSessionUrl) - pino 9 -> 10, pino-http 10 -> 11, thread-stream 3 -> 4 - zod 3.25 -> 4.4 (catalog; supported by drizzle-zod 0.8.3) - pg 8.20 -> 8.22; removed deprecated @types/bcryptjs Frontend: - react/react-dom 19.1.0 -> 19.2.8 (catalog pin lifted; expo note removed) - react-day-picker 9 -> 10 (table classname -> month_grid) - recharts 2 -> 3 (TooltipContentProps + DefaultLegendContentProps typing; safe keys) - react-resizable-panels 2 -> 4 (Group/Separator rename) - date-fns 3 -> 4, @hookform/resolvers 3 -> 5, lucide-react 0.545 -> 1.28 - all @radix-ui/*, tailwind, types, and remaining patch/minor deps bumped to latest Security/process: - overrides for body-parser >=2.3.0 (GHSA-v422-hmwv-36x6) + markdown-it/linkify-it/brace-expansion/fast-uri (dev tooling) - pnpm audit now reports 0 vulnerabilities (prod and full) - CI audit gate added to build.yaml; docs/dependency-policy.md; renovate.json - Dockerfile pins node:24.18.1-alpine and pnpm@11.18.0
77 lines
2.5 KiB
YAML
77 lines
2.5 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 pnpm
|
|
run: npm install -g pnpm@11.18.0
|
|
|
|
- name: Security audit (fails on any prod or high/critical finding)
|
|
run: |
|
|
pnpm audit --prod
|
|
pnpm audit --audit-level high
|
|
|
|
- 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)
|
|
if [ "${{ gitea.ref_type }}" = "tag" ]; then
|
|
NEWTAG="${{ gitea.ref_name }}"
|
|
else
|
|
NEWTAG="sha-${SHA}"
|
|
fi
|
|
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: ${NEWTAG}|" 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 ${NEWTAG}"
|
|
git push
|