kind: pipeline
name: 基础 CI 流程
type: docker

steps:
  - name: 构建 Docker 镜像
    image: plugins/docker:latest
    privileged: true
    settings:
      username: kagami-ci
      password:
        from_secret: KAGAMI-CI-PASSWORD
      repo: gitea.service.jazzwhom.top/kagami-ci/blog-frontend-v2
      registry: gitea.service.jazzwhom.top
      tags:
        - nightly
        - nightly-${DRONE_COMMIT_SHA}
      dockerfile: Dockerfile
    volumes:
      - name: docker-socket
        path: /var/run/docker.sock
  - name: 触发 Webhook
    image: plugins/webhook
    settings:
      urls:
        from_secret: DEPLOY-WEBHOOK-URL
  - name: 发送构建结果到 ntfy
    image: parrazam/drone-ntfy
    when:
      status: [success, failure]
    settings:
      url: https://ntfy.service.jazzwhom.top
      topic: drone_ci
      tags:
        - drone-ci
      token:
        from_secret: NTFY_TOKEN

volumes:
  - name: docker-socket
    host:
      path: /var/run/docker.sock
