2023-11-21 00:53:08 +00:00
|
|
|
when:
|
|
|
|
event: [push, deployment, manual, cron]
|
|
|
|
|
|
|
|
labels:
|
|
|
|
platform: linux/amd64
|
|
|
|
|
|
|
|
variables:
|
|
|
|
- &node_image 'node:14-bullseye'
|
|
|
|
- &buildx_image 'woodpeckerci/plugin-docker-buildx:2.2.1'
|
|
|
|
- &platforms 'linux/amd64'
|
|
|
|
- &dockerfile 'docker/Dockerfile.ci'
|
|
|
|
|
|
|
|
|
|
|
|
steps:
|
|
|
|
prepare-npm:
|
|
|
|
image: *node_image
|
|
|
|
secrets:
|
|
|
|
- npmconf
|
|
|
|
commands:
|
|
|
|
- git config --add safe.directory '*'
|
|
|
|
- if [ "$${NPMCONF:-}" != "" ]; then echo "$${NPMCONF}" >> "$${HOME}/.npmrc"; fi
|
|
|
|
- npm ci
|
|
|
|
- npx browserslist@latest --update-db
|
|
|
|
|
|
|
|
build-npm:
|
|
|
|
image: *node_image
|
|
|
|
commands:
|
2023-11-21 15:47:16 +00:00
|
|
|
- bash ./scripts/build.sh web dev
|
2023-11-21 00:53:08 +00:00
|
|
|
|
|
|
|
build-docker-next:
|
|
|
|
image: *buildx_image
|
|
|
|
pull: true
|
|
|
|
settings:
|
|
|
|
platforms: *platforms
|
|
|
|
dockerfile: *dockerfile
|
|
|
|
context: .
|
|
|
|
registry:
|
|
|
|
from_secret: registry_domain
|
|
|
|
repo:
|
|
|
|
from_secret: target_image_name
|
|
|
|
password:
|
|
|
|
from_secret: registry_token
|
|
|
|
username:
|
|
|
|
from_secret: registry_user
|
|
|
|
auto_tag: true
|
|
|
|
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:
|
|
|
|
platforms: *platforms
|
|
|
|
dockerfile: *dockerfile
|
|
|
|
context: .
|
|
|
|
registry:
|
|
|
|
from_secret: registry_domain
|
|
|
|
repo:
|
|
|
|
from_secret: target_image_name
|
|
|
|
password:
|
|
|
|
from_secret: registry_token
|
|
|
|
username:
|
|
|
|
from_secret: registry_user
|
|
|
|
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:
|
|
|
|
platforms: *platforms
|
|
|
|
dockerfile: *dockerfile
|
|
|
|
context: .
|
|
|
|
registry:
|
|
|
|
from_secret: registry_domain
|
|
|
|
repo:
|
|
|
|
from_secret: target_image_name
|
|
|
|
password:
|
|
|
|
from_secret: registry_token
|
|
|
|
username:
|
|
|
|
from_secret: registry_user
|
|
|
|
auto_tag: true
|
|
|
|
tag: [latest, "${CI_COMMIT_TAG}", "tag-${CI_COMMIT_SHA:0:8}"]
|
|
|
|
when:
|
|
|
|
event: [tag]
|