60 lines
1.3 KiB
YAML
60 lines
1.3 KiB
YAML
kind: pipeline
|
|
type: docker
|
|
name: build-test-and-push
|
|
|
|
trigger:
|
|
event:
|
|
- push
|
|
branch:
|
|
- main
|
|
|
|
steps:
|
|
- name: install+lint+typecheck+test
|
|
image: node:20-alpine
|
|
environment:
|
|
PNPM_HOME: /root/.local/share/pnpm
|
|
commands:
|
|
- corepack enable
|
|
- corepack prepare pnpm@9.12.0 --activate
|
|
- pnpm install --frozen-lockfile
|
|
- pnpm lint
|
|
- pnpm typecheck
|
|
- pnpm test -- --run
|
|
|
|
- name: docker-push
|
|
image: plugins/docker:latest
|
|
settings:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
|
|
# Registry och repo
|
|
registry: rubble.se:5000
|
|
repo: rubble.se:5000/urban/hemhub-web
|
|
|
|
# Inloggning (lägg in som secrets i Drone)
|
|
username:
|
|
from_secret: REGISTRY_USER
|
|
password:
|
|
from_secret: REGISTRY_PASS
|
|
|
|
# Bygg-args till Dockerfile (Vite läser dem vid build)
|
|
build_args:
|
|
- VITE_API_BASE_URL=${VITE_API_BASE_URL}
|
|
- VITE_BASE_PATH=/hemhub/
|
|
|
|
# Taggar
|
|
tags:
|
|
- latest
|
|
- ${DRONE_COMMIT_SHA:0:7}
|
|
|
|
# Sätt till false/ta bort om ditt registry har TLS
|
|
insecure: true
|
|
|
|
environment:
|
|
# Drone-secret för backend-url, sätt i UI under repo -> Secrets
|
|
VITE_API_BASE_URL:
|
|
from_secret: VITE_API_BASE_URL
|
|
|
|
depends_on:
|
|
- install+lint+typecheck+test
|