Skip to content

Commit b904d0a

Browse files
feat: add cnb button
1 parent 19ec610 commit b904d0a

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

.cnb.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
main:
2+
build_node_image:
3+
- services:
4+
- docker
5+
imports: https://cnb.cool/1Panel-dev/secrets/-/blob/main/docker-1panel-envs.yml
6+
stages:
7+
- name: set docker tag
8+
script: echo -n "${DOCKER_REGISTRY}/${DOCKER_GROUP}$/node$:$NODE_VERSION"
9+
exports:
10+
info: IMAGE_TAG
11+
12+
- name: docker login
13+
script: docker login -u ${DOCKER_USER} -p "${DOCKER_PWD}" ${DOCKER_REGISTRY}
14+
15+
- name: docker build
16+
script: docker build --build-arg NODE_VERSION=$NODE_VERSION -t $IMAGE_TAG node/Dockerfile
17+
18+
- name: push image
19+
script: docker push $IMAGE_TAG

.cnb/web_trigger.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
branch:
2+
- buttons:
3+
- name: "编译 Node.js 镜像"
4+
event: build_node_image
5+
permissions:
6+
roles:
7+
- owner
8+
inputs:
9+
NODE_VERSION:
10+
name: "Node.js 版本"
11+
description: "Node.js 版本"
12+
default: "18.20.8"
13+
required: true
14+
# node21Version:
15+
# name: "Node.js 21.x 版本"
16+
# description: "Node.js 21.x 版本"
17+
# default: "21.7.3"
18+
# required: true
19+
# node20Version:
20+
# name: "Node.js 20.x 版本"
21+
# description: "Node.js 20.x 版本"
22+
# default: "20.19.3"
23+
# required: true
24+
# node18Version:
25+
# name: "Node.js 18.x 版本"
26+
# description: "Node.js 18.x 版本"
27+
# default: "18.20.8"
28+
# required: true

.github/workflows/sync-to-cnb.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ jobs:
2020
-e PLUGIN_AUTH_TYPE="https" \
2121
-e PLUGIN_USERNAME="cnb" \
2222
-e PLUGIN_PASSWORD=${{ secrets.CNB_PASSWORD }} \
23+
-e PLUGIN_FORCE=true \
2324
tencentcom/git-sync

0 commit comments

Comments
 (0)