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:
- &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]