iloom-flatten/.gitlab-ci.yml
Chever John e399f0070e
feat: add Dockerfile and GitLab CI pipeline for Harbor
Multi-stage Docker build: node:20-alpine + nginx:1.27-alpine.
CI builds and pushes to harbor-in-k3s.cheverjohn.me/iloom/iloom-frontend.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-06-17 10:01:55 +08:00

28 lines
706 B
YAML

stages:
- build
variables:
HARBOR_REGISTRY: harbor-in-k3s.cheverjohn.me
HARBOR_PROJECT: iloom
DOCKER_TLS_CERTDIR: "/certs"
build-frontend:
stage: build
image: docker:27
services:
- docker:27-dind
before_script:
- echo "$HARBOR_PASSWORD" | docker login $HARBOR_REGISTRY -u "$HARBOR_USER" --password-stdin
script:
- |
if [ -n "$CI_COMMIT_TAG" ]; then
TAG="$CI_COMMIT_TAG"
else
TAG="main-${CI_COMMIT_SHORT_SHA}"
fi
- docker build -t $HARBOR_REGISTRY/$HARBOR_PROJECT/iloom-frontend:$TAG .
- docker push $HARBOR_REGISTRY/$HARBOR_PROJECT/iloom-frontend:$TAG
rules:
- if: $CI_COMMIT_BRANCH == "main"
- if: $CI_COMMIT_TAG =~ /^v/