initial
This commit is contained in:
48
.gitlab-ci.yml
Normal file
48
.gitlab-ci.yml
Normal file
@@ -0,0 +1,48 @@
|
||||
image: node:18.18.2
|
||||
|
||||
stages:
|
||||
- install
|
||||
- build
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
NODE_ENV: 'production'
|
||||
|
||||
cache:
|
||||
paths:
|
||||
- node_modules/
|
||||
|
||||
before_script:
|
||||
- echo "Setting up environment"
|
||||
- echo "@popiplay:registry=https://gitlab.popiplay.dev/api/v4/projects/fe%2Fnpm%2Fstate-machine/packages/npm/" > .npmrc
|
||||
- echo "//gitlab.popiplay.dev/api/v4/projects/fe%2Fnpm%2Fstate-machine/packages/npm/:_authToken=${CI_JOB_TOKEN}" >> .npmrc
|
||||
|
||||
build:
|
||||
stage: build
|
||||
script:
|
||||
- rm -rf node_modules package-lock.json
|
||||
- npm install --include=dev
|
||||
- npm run build
|
||||
artifacts:
|
||||
paths:
|
||||
- lib/ # Сохраняем собранные файлы в артефакты, чтобы они были доступны на этапе deploy
|
||||
|
||||
publish master:
|
||||
stage: deploy
|
||||
script:
|
||||
- git config --global user.email ${GITLAB_USER_EMAIL}
|
||||
- git config --global user.name ${GITLAB_USER_LOGIN}
|
||||
- npm version patch
|
||||
- npm publish --access=public
|
||||
only:
|
||||
- master # Публиковать только при изменениях в main ветке
|
||||
|
||||
publish branch:
|
||||
stage: deploy
|
||||
script:
|
||||
- git config --global user.email ${GITLAB_USER_EMAIL}
|
||||
- git config --global user.name ${GITLAB_USER_LOGIN}
|
||||
- npm version prerelease --preid=dev
|
||||
- npm publish --access=public
|
||||
except:
|
||||
- master
|
||||
Reference in New Issue
Block a user