diff --git a/.drone.yml b/.drone.yml index 06fde88..486ee7d 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,7 +1,63 @@ +--- +kind: pipeline +name: base +type: docker + +steps: + - name: install + image: plugins/docker + settings: + registry: docker-registry.ivanli.cc + username: + from_secret: ivan-docker-username + password: + from_secret: ivan-docker-password + repo: docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base + cache_from: + - docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base:${DRONE_BRANCH}${DRONE_TAG}-amd64 + dockerfile: Dockerfile + target: base + tags: + - '${DRONE_COMMIT_SHA:0:8}-amd64' + - '${DRONE_BRANCH}${DRONE_TAG}-amd64' + + - name: notify + image: appleboy/drone-telegram + when: + status: + - failure + failure: ignore + detach: true + environment: + PLUGIN_TOKEN: + from_secret: drone-telegram-bot-token + PLUGIN_TO: + from_secret: telegram-notify-to + settings: + format: markdown + message: > + {{#success build.status}} + ✅ Install Deps #{{build.number}} of `{{repo.name}}` succeeded. + 📝 Commit by {{commit.author}} on `{{commit.branch}}`: + ``` + {{commit.message}} + ``` + 🌐 {{ build.link }} + {{else}} + ❌ Install Deps #{{build.number}} of `{{repo.name}}` failed. + 📝 Commit by {{commit.author}} on `{{commit.branch}}`: + ``` + {{commit.message}} + ``` + 🌐 {{ build.link }} + {{/success}} + --- kind: pipeline name: linux-amd64 type: docker +depends_on: + - base steps: - name: build&publish @@ -16,6 +72,7 @@ steps: dockerfile: Dockerfile target: release cache_from: + - docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-base:${DRONE_BRANCH}${DRONE_TAG}-amd64 - docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog:${DRONE_BRANCH}${DRONE_TAG}-amd64 tags: - '${DRONE_COMMIT_SHA:0:8}'