GitLab CI/CD实现软件开发自动化。
stages: - build - test build: stage: build script: - echo "Building..." - npm install - npm run build test: stage: test script: - echo "Testing..." - npm test
build: stage: build image: node:20 script: - npm ci - npm run build artifacts: paths: - dist/
test: stage: test image: node:20 dependencies: - build script: - npm run test
cache: paths: - node_modules/ build: script: - npm ci - npm run build
build: artifacts: paths: - dist/ expire_in: 7 days script: - npm run build
deploy: stage: deploy script: - ./release.sh only: - main
GitLab自动化提升开发效率。