From 717b2791f3fd4c9d851728871f44ebced9658642 Mon Sep 17 00:00:00 2001 From: cxhello Date: Thu, 14 Aug 2025 19:17:20 +0800 Subject: [PATCH 1/3] docs: update readme --- README.md | 1 + README_ZH.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 9e4caba..a9ebac1 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,7 @@ Run the following command: | NACOS_AUTH_CONSOLE_ENABLE | nacos.core.auth.console.enable | default : `true` | | | NACOS_CONSOLE_PORT | nacos.console.port | default : `8080` | | NACOS_CONSOLE_CONTEXTPATH | nacos.console.contextPath | default : `` | +| NACOS_DEPLOYMENT_TYPE | nacos.deployment.type | default : `merged` support config server console | ## Advanced configuration diff --git a/README_ZH.md b/README_ZH.md index dda853b..066efe8 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -182,6 +182,7 @@ NACOS_VERSION=v3.0.2-slim | NACOS_AUTH_CONSOLE_ENABLE | nacos.core.auth.console.enable | default : `true` | | | NACOS_CONSOLE_PORT | nacos.console.port | default : `8080` | | NACOS_CONSOLE_CONTEXTPATH | nacos.console.contextPath | default : `` | +| NACOS_DEPLOYMENT_TYPE | nacos.deployment.type | default : `merged` 支持配置 server console | ## 高级配置 From fa7fcb82eacc4cefb0e28ce1401b3b907fd99337 Mon Sep 17 00:00:00 2001 From: cxhello Date: Fri, 15 Aug 2025 09:41:19 +0800 Subject: [PATCH 2/3] docs: update readme --- README.md | 2 +- README_ZH.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a9ebac1..a3f8875 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ Run the following command: | NACOS_AUTH_CONSOLE_ENABLE | nacos.core.auth.console.enable | default : `true` | | | NACOS_CONSOLE_PORT | nacos.console.port | default : `8080` | | NACOS_CONSOLE_CONTEXTPATH | nacos.console.contextPath | default : `` | -| NACOS_DEPLOYMENT_TYPE | nacos.deployment.type | default : `merged` support config server console | +| NACOS_DEPLOYMENT_TYPE | nacos.deployment.type | default : `merged` support config `server` `console` | ## Advanced configuration diff --git a/README_ZH.md b/README_ZH.md index 066efe8..256f1c5 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -182,7 +182,7 @@ NACOS_VERSION=v3.0.2-slim | NACOS_AUTH_CONSOLE_ENABLE | nacos.core.auth.console.enable | default : `true` | | | NACOS_CONSOLE_PORT | nacos.console.port | default : `8080` | | NACOS_CONSOLE_CONTEXTPATH | nacos.console.contextPath | default : `` | -| NACOS_DEPLOYMENT_TYPE | nacos.deployment.type | default : `merged` 支持配置 server console | +| NACOS_DEPLOYMENT_TYPE | nacos.deployment.type | default : `merged` 支持配置 `server` `console` | ## 高级配置 From ec8d23ca4393ce08b73d998428d004f05fb46a99 Mon Sep 17 00:00:00 2001 From: cxhello Date: Tue, 26 May 2026 18:22:45 +0800 Subject: [PATCH 3/3] ci: add PR validation workflow and upgrade Actions versions Add ci.yml for pull request validation with build test and smoke test. Upgrade build&push.yaml Actions from v1/v2 to v3/v4/v5/v6 and replace deprecated set-output with GITHUB_OUTPUT. Signed-off-by: cxhello --- .github/workflows/build&push.yaml | 37 ++++++++--------- .github/workflows/ci.yml | 68 +++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build&push.yaml b/.github/workflows/build&push.yaml index 25bfcc4..bc05ea6 100644 --- a/.github/workflows/build&push.yaml +++ b/.github/workflows/build&push.yaml @@ -1,8 +1,3 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - name: Publish Docker image on: @@ -18,33 +13,33 @@ jobs: - name: Extract Version id: version_step run: | - echo "##[set-output name=version;]NACOS_VERSION=${GITHUB_REF#$"refs/tags/v"}" + echo "version=NACOS_VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 1 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: nacos/nacos-server - name: Build and push Docker image - uses: docker/build-push-action@v2.3.0 + uses: docker/build-push-action@v6 with: context: build platforms: linux/amd64,linux/arm64 @@ -52,7 +47,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: ${{steps.version_step.outputs.version}} + build-args: ${{ steps.version_step.outputs.version }} push_to_multi_platforms_registry: name: Push Docker slim image to Docker Hub @@ -61,28 +56,28 @@ jobs: - name: Extract Version id: version_step run: | - echo "##[set-output name=version;]NACOS_VERSION=${GITHUB_REF#$"refs/tags/v"}" + echo "version=NACOS_VERSION=${GITHUB_REF#refs/tags/v}" >> "$GITHUB_OUTPUT" - name: Check out the repo - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: fetch-depth: 1 - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Log in to Docker Hub - uses: docker/login-action@v1 + uses: docker/login-action@v3 with: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Extract metadata (tags, labels) for Docker id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: images: nacos/nacos-server flavor: | @@ -91,7 +86,7 @@ jobs: type=pep440,pattern=v{{version}}-slim - name: Build and push Docker image - uses: docker/build-push-action@v2.3.0 + uses: docker/build-push-action@v6 with: context: build platforms: linux/amd64,linux/arm64 @@ -99,4 +94,4 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - build-args: ${{steps.version_step.outputs.version}} + build-args: ${{ steps.version_step.outputs.version }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d214b8d --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: CI + +on: + pull_request: + branches: [master] + +jobs: + build-test: + name: Build Image + runs-on: ubuntu-latest + strategy: + matrix: + include: + - name: standard + file: build/Dockerfile + - name: slim + file: build/Dockerfile.Slim + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - uses: docker/setup-buildx-action@v3 + - name: Build ${{ matrix.name }} + uses: docker/build-push-action@v6 + with: + context: build + file: ${{ matrix.file }} + platforms: linux/amd64,linux/arm64 + push: false + load: false + + smoke-test: + name: Smoke Test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-buildx-action@v3 + - name: Build image + uses: docker/build-push-action@v6 + with: + context: build + file: build/Dockerfile + platforms: linux/amd64 + push: false + load: true + tags: nacos-smoke:test + - name: Run smoke test + run: | + docker run -d --name nacos-test \ + -e MODE=standalone \ + -e NACOS_AUTH_TOKEN=VGhpc0lzTXlDdXN0b21TZWNyZXRLZXkwMTIzNDU2Nzg= \ + -e NACOS_AUTH_IDENTITY_KEY=test \ + -e NACOS_AUTH_IDENTITY_VALUE=test \ + -p 8848:8848 nacos-smoke:test + + echo "Waiting for Nacos to start..." + for i in $(seq 1 60); do + if curl -sf http://localhost:8848/nacos/ > /dev/null 2>&1; then + echo "Nacos is ready after $((i * 2))s" + exit 0 + fi + sleep 2 + done + echo "::error::Nacos failed to start within 120s" + docker logs nacos-test + exit 1 + - name: Cleanup + if: always() + run: docker rm -f nacos-test 2>/dev/null || true