kind: pipeline
type: kubernetes
name: build-backstage

steps:
  - name: build-backend
    image: node:18-bookworm
    commands:
      - corepack enable
      - yarn install --immutable
      - yarn tsc
      - yarn build:backend

  - name: docker-build-push
    image: plugins/docker
    privileged: true
    settings:
      registry: registre.rber.bj
      repo: registre.rber.bj/rber/backstage
      tags:
        - v0.1.0
        - latest
      dockerfile: packages/backend/Dockerfile
      username:
        from_secret: harbor_username
      password:
        from_secret: harbor_password

trigger:
  branch:
    - main
  event:
    - push
