From d841f3f3d4724c84e0325e7b3a5aaac17dbe5cd8 Mon Sep 17 00:00:00 2001 From: Keannu Bernasol Date: Thu, 27 Mar 2025 02:03:14 +0800 Subject: [PATCH] Update .yml files --- .woodpecker/.build.yml | 44 ++++++++++++++++++++++++++++++++--------- .woodpecker/.deploy.yml | 32 +++++++++++++++++++++++++++--- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/.woodpecker/.build.yml b/.woodpecker/.build.yml index 8e5f34b..9ac87b6 100644 --- a/.woodpecker/.build.yml +++ b/.woodpecker/.build.yml @@ -4,15 +4,6 @@ labels: steps: - name: build image: docker - when: - - branch: master - event: push - commands: - - docker build -t "$REGISTRY_IMAGE_TAG" . - - echo "$FORGEJO_REGISTRY_PASSWORD" | docker login "$FORGEJO_REGISTRY_URL" --password-stdin -u "$FORGEJO_REGISTRY_USERNAME" - - docker push "$REGISTRY_IMAGE_TAG" - volumes: - - /var/run/docker.sock:/var/run/docker.sock environment: FORGEJO_REGISTRY_URL: from_secret: FORGEJO_REGISTRY_URL @@ -22,3 +13,38 @@ steps: from_secret: FORGEJO_REGISTRY_PASSWORD REGISTRY_IMAGE_TAG: from_secret: REGISTRY_IMAGE_TAG + commands: + - docker build -t "$REGISTRY_IMAGE_TAG" . + - echo "$FORGEJO_REGISTRY_PASSWORD" | docker login "$FORGEJO_REGISTRY_URL" --password-stdin -u "$FORGEJO_REGISTRY_USERNAME" + - docker push "$REGISTRY_IMAGE_TAG" + volumes: + - /var/run/docker.sock:/var/run/docker.sock + when: + - branch: master + event: push + - name: mail_success + image: deblan/woodpecker-email" + settings: + dsn: + - from_secret: SMTP_SELFHOSTED_DSN + from: + address: + - from_secret: SMTP_SELFHOSTED_FROM_EMAIL + name: + - from_secret: SMTP_EMAIL_NAME + evaluate: 'commit.branch == "master"' + recipients: + - from_secret: SMTP_SELFHOSTED_EMAIL_TO_1 + level: success + recipients_only: false + content: + subject: "[{{ pipeline.status }}] {{ repo.full_name }} ({{ commit.branch }} - {{ commit.sha[0:8] }}" + body: | + {{ commit.sha }}
+ {{ pipeline.status }}
+ {{ commit.author_email }}
+ attachments: + - log/* + when: + status: + - success diff --git a/.woodpecker/.deploy.yml b/.woodpecker/.deploy.yml index dc589a9..69ed4b0 100644 --- a/.woodpecker/.deploy.yml +++ b/.woodpecker/.deploy.yml @@ -1,9 +1,6 @@ steps: - name: deploy image: node:18-alpine - when: - - branch: master - event: push environment: CLOUDFLARE_ACCOUNT_ID: from_secret: CLOUDFLARE_ACCOUNT_ID @@ -13,3 +10,32 @@ steps: - npm install --save-dev - npm run build - npx wrangler pages deploy "./build/" --project-name blog --branch master --commit-dirty + when: + - branch: master + event: push + - name: mail_success + image: deblan/woodpecker-email" + settings: + dsn: + - from_secret: SMTP_SELFHOSTED_DSN + from: + address: + - from_secret: SMTP_SELFHOSTED_FROM_EMAIL + name: + - from_secret: SMTP_EMAIL_NAME + evaluate: 'commit.branch == "master"' + recipients: + - from_secret: SMTP_SELFHOSTED_EMAIL_TO_1 + level: success + recipients_only: false + content: + subject: "[{{ pipeline.status }}] {{ repo.full_name }} ({{ commit.branch }} - {{ commit.sha[0:8] }}" + body: | + {{ commit.sha }}
+ {{ pipeline.status }}
+ {{ commit.author_email }}
+ attachments: + - log/* + when: + status: + - success