From ddb37b5c821669a714efbf979969df73d4498d73 Mon Sep 17 00:00:00 2001 From: nocci Date: Sat, 7 Mar 2026 12:45:30 +0000 Subject: [PATCH] ci(workflow): simplify Node.js installation and optimize Docker steps Replace multi-step Node.js and npm install with single Alpine package install, and simplify Docker builder setup by switching from GitHub Action to direct CLI installation via apk. Also enable network debugging tools for better troubleshooting in the CI environment. --- .forgejo/workflows/build.yml | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 6d0621b..8c9c740 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -46,18 +46,9 @@ jobs: - name: Install Node.js and Sonar Scanner run: | + apk add --no-cache nodejs npm curl npm install -g sonarqube-scanner - - name: Install Node.js - run: | - apt-get update - apt-get install -y curl - curl -fsSL https://deb.nodesource.com/setup_20.x | bash - - apt-get install -y nodejs - - - name: Install Sonar Scanner (npm) - run: npm install -g sonarqube-scanner - - name: SonarQube Scan env: SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} @@ -100,9 +91,12 @@ jobs: docker: needs: [lint, sonar] runs-on: self-hosted + container: + image: node:20-alpine steps: - name: Network Debugging run: | + apk add --no-cache iputils bind-tools cat /etc/resolv.conf cat /etc/hosts ping -c 4 server @@ -116,7 +110,8 @@ jobs: git checkout FETCH_HEAD - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + run: | + apk add --no-cache docker-cli docker-cli-compose - name: Login to registry run: echo "${{ secrets.REG_TOKEN }}" | docker login "${{ secrets.REGISTRY }}" -u "${{ secrets.REG_USER }}" --password-stdin