update build

lanparty
gapodo 2023-11-20 13:52:23 +01:00
parent 2a1fd11e2d
commit 24c6a1e22e
1 changed files with 39 additions and 13 deletions

View File

@ -7,6 +7,19 @@ labels:
variables: variables:
- &node_image 'node:14-bullseye' - &node_image 'node:14-bullseye'
- &buildx_image 'woodpeckerci/plugin-docker-buildx:2.2.1' - &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: steps:
prepare-npm: prepare-npm:
@ -24,20 +37,33 @@ steps:
commands: commands:
- bash ./scripts/build.sh web rel - bash ./scripts/build.sh web rel
build-docker: build-docker-next:
image: *buildx_image image: *buildx_image
pull: true pull: true
settings: settings:
platforms: linux/amd64 <<:*buildx_base_settings
dockerfile: docker/Dockerfile.ci
context: .
registry:
from_secret: registry_domain
auto_tag: true auto_tag: true
tag: latest tag: [next, "next-${CI_COMMIT_SHA:0:8}"]
repo: when:
from_secret: target_image_name branch: ${CI_REPO_DEFAULT_BRANCH}
password: event: push
from_secret: registry_token
username: build-docker-branch:
from_secret: registry_user 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]