From 864085ea4a9d1d9b5f6405a6064de2f7b1b8be23 Mon Sep 17 00:00:00 2001 From: Ivan Li Date: Sun, 26 Feb 2023 13:53:59 +0000 Subject: [PATCH] =?UTF-8?q?build:=20=E6=94=AF=E6=8C=81=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=B9=B6=E4=B8=8A=E4=BC=A0=E7=BD=91=E9=A1=B5=E5=88=B0=E6=99=AF?= =?UTF-8?q?=E5=AE=89=E8=99=9A=E6=9C=BA=E3=80=82x2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .drone.yml | 65 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 26 deletions(-) diff --git a/.drone.yml b/.drone.yml index 75f4ee9..9104fcc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -119,7 +119,7 @@ kind: pipeline type: docker name: deploy clone: - disable: true + disable: false depends_on: - linux-amd64 @@ -177,36 +177,48 @@ kind: pipeline type: docker name: deploy-to-zzidc clone: - disable: true + disable: false depends_on: - linux-amd64 +trigger: + branch: + - master + - develop + steps: - name: export - 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-upload - dockerfile: Dockerfile - target: upload - cache_from: - - docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-upload:${DRONE_BRANCH}${DRONE_TAG}-amd64 - tags: - - '${DRONE_COMMIT_SHA:0:8}' - - '${DRONE_BRANCH}${DRONE_TAG}' + 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-upload + dockerfile: Dockerfile + target: upload + cache_from: + - docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-upload:${DRONE_BRANCH}${DRONE_TAG}-amd64 + tags: + - '${DRONE_COMMIT_SHA:0:8}' + - '${DRONE_BRANCH}${DRONE_TAG}' + - name: upload - image: docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-upload:${DRONE_COMMIT_SHA:0:8} - environment: - FTP_ACCOUNT: - from_secret: zzidc_ftp_account - FTP_PASSWORD: - from_secret: zzidc_ftp_password - FTP_HOST: - from_secret: zzidc_ftp_host + image: docker:dind + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + - docker run --rm -it -e FTP_ACCOUNT=${FTP_ACCOUNT} -e FTP_PASSWORD=${FTP_PASSWORD} -e FTP_HOST=${FTP_HOST} docker-registry.ivanli.cc/ivan/tailwind-nextjs-blog-upload:${DRONE_COMMIT_SHA:0:8} + environment: + FTP_ACCOUNT: + from_secret: zzidc_ftp_account + FTP_PASSWORD: + from_secret: zzidc_ftp_password + FTP_HOST: + from_secret: zzidc_ftp_host + - name: notify image: appleboy/drone-telegram when: @@ -237,4 +249,5 @@ steps: {{commit.message}} ``` 🌐 {{ build.link }} - {{/success}} \ No newline at end of file + {{/success}} +