stages: - build - pages - publish .start_pipeline: &start_pipeline - apt-get update && apt-get install -y git gettext - git clone https://${CI_TEMPLATES_GIT_USER}:${CI_TEMPLATES_GIT_PASSWORD}@${CI_TEMPLATES_GIT_PROJECT_URL} - cd ci-templates - scripts/notify-slack-start-pipeline.sh - cd ../ build: stage: build tags: - docker environment: name: staging before_script: - *start_pipeline image: node:16 script: - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc - npm install - npm run build - npm publish || EXIT_STATUS=$? - exit ${EXIT_STATUS} - EXIT_STATUS=$? - cd ci-templates - scripts/notify-slack-deploy.sh ${EXIT_STATUS} - ls -lart artifacts: paths: - node_modules/ - coverage/ publish: stage: publish tags: - docker environment: name: production image: node:16 script: - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc - EXIT_STATUS=0 - npm install - npm run build - npm publish || EXIT_STATUS=$? - git clone https://${CI_TEMPLATES_GIT_USER}:${CI_TEMPLATES_GIT_PASSWORD}@${CI_TEMPLATES_GIT_PROJECT_URL} - cd ci-templates - scripts/notify-slack-deploy.sh ${EXIT_STATUS} - exit ${EXIT_STATUS} rules: - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH when: manual artifacts: paths: - node_modules/ pages: stage: pages image: node:latest tags: - docker script: - npm install - npm run build - cd docs - npm install - npm run build:gitlab - cd .. - mkdir public - mv docs/public/* public artifacts: paths: - public rules: - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'