gilde-ci-cd/templates/npm/npm-build.gitlab-ci.yml

23 lines
457 B
YAML

.npm-build:
image: $NODE_IMAGE
stage: build
variables:
FRONTEND_BUILD_DIR: '**/dist'
before_script:
- >
if [ "$FRONTEND_DIR" != "" ]; then
cd $FRONTEND_DIR
fi
# Requires npm > 8.X
- >
if [ "$CI_COMMIT_TAG" != "" ]; then
npm --no-git-tag-version version from-git
fi
script:
- npm run ci:build
artifacts:
expire_in: 2 weeks
when: always
paths:
- '$FRONTEND_BUILD_DIR'