# Woodpecker CI step for {{COMPONENT_NAME}} React app
# Add this step to your .woodpecker.yml

build-{{COMPONENT_NAME}}:
  image: woodpeckerci/plugin-kaniko
  settings:
    registry: registry.threesix.ai
    repo: {{PROJECT_NAME}}/{{COMPONENT_NAME}}
    tags:
      - latest
      - ${CI_COMMIT_SHA:0:8}
    context: .
    dockerfile: apps/{{COMPONENT_NAME}}/Dockerfile
    cache: true
    skip-tls-verify: true
  when:
    branch: main
    event: push

deploy-{{COMPONENT_NAME}}:
  image: bitnami/kubectl:latest
  commands:
    - kubectl set image deployment/{{PROJECT_NAME}}-{{COMPONENT_NAME}} {{COMPONENT_NAME}}=registry.threesix.ai/{{PROJECT_NAME}}/{{COMPONENT_NAME}}:${CI_COMMIT_SHA:0:8} -n projects || echo "Deployment not found, skipping"
  when:
    branch: main
    event: push
