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.
This commit is contained in:
nocci 2026-03-07 12:45:30 +00:00
parent 09d854ffb1
commit ddb37b5c82

View file

@ -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