From 24c6a1e22e583597f1d1fa9268db5ba89885d96e Mon Sep 17 00:00:00 2001 From: Gapodo Date: Mon, 20 Nov 2023 13:52:23 +0100 Subject: [PATCH] update build --- .woodpecker/base.yaml | 52 ++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/.woodpecker/base.yaml b/.woodpecker/base.yaml index 3d03cd65..5227462d 100644 --- a/.woodpecker/base.yaml +++ b/.woodpecker/base.yaml @@ -7,6 +7,19 @@ labels: variables: - &node_image 'node:14-bullseye' - &buildx_image 'woodpeckerci/plugin-docker-buildx:2.2.1' + - buildx_base_settings: &buildx_base_settings + platforms: linux/amd64 + dockerfile: docker/Dockerfile.ci + context: . + registry: + from_secret: registry_domain + repo: + from_secret: target_image_name + password: + from_secret: registry_token + username: + from_secret: registry_user + steps: prepare-npm: @@ -24,20 +37,33 @@ steps: commands: - bash ./scripts/build.sh web rel - build-docker: + build-docker-next: image: *buildx_image pull: true settings: - platforms: linux/amd64 - dockerfile: docker/Dockerfile.ci - context: . - registry: - from_secret: registry_domain + <<:*buildx_base_settings auto_tag: true - tag: latest - repo: - from_secret: target_image_name - password: - from_secret: registry_token - username: - from_secret: registry_user + tag: [next, "next-${CI_COMMIT_SHA:0:8}"] + when: + branch: ${CI_REPO_DEFAULT_BRANCH} + event: push + + build-docker-branch: + image: *buildx_image + pull: true + settings: + <<:*buildx_base_settings + auto_tag: true + tag: ["${CI_COMMIT_BRANCH}", "${CI_COMMIT_BRANCH}-${CI_COMMIT_SHA:0:8}"] + when: + event: [push, manual] + + build-docker-tag: + image: *buildx_image + pull: true + settings: + <<:*buildx_base_settings + auto_tag: true + tag: [latest, "${CI_COMMIT_TAG}", "tag-${CI_COMMIT_SHA:0:8}"] + when: + event: [tag]