release storybook to npm from GitLab
ArouiniLobna opened this issue · 0 comments
ArouiniLobna commented
Hi,
I am using Gitlab to host my repository and I have followed the instructions step by step when it comes to creating a design system.
When I reach the stage where I have to publish to NPM, I am stuck. Because I am using Gitlab, they are not GitHub actions and can't use Auto. Somehow got the chromatic work without using Github actions but not successful when reaching the releasing part https://storybook.js.org/tutorials/design-systems-for-developers/react/en/distribute/
Through my project, I am using semantic release for versioning, this how my current yml file looks like:
include:
- project: "XXXXXXXX"
ref: master
file:
- yyyyyyyyy.yml
image: node:12
# Sets the stages for the pipeline
stages:
- publish
- tag
# Cache the dependencies
cache:
key: $CI_COMMIT_REF_SLUG-$CI_PROJECT_DIR
paths:
- .yarn-cache
- node_modules
.install-dependencies:
before_script:
- yarn install --frozen-lockfile --prefer-offline --cache-folder .yarn
publish:
stage: publish
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
script:
- yarn install --frozen-lockfile --prefer-offline --cache-folder .yarn
- yarn build-storybook
- npx chromatic --storybook-build-dir ./storybook-static --project-token $CHROMATIC_PROJECT_TOKEN --exit-zero-on-changes
Release:
stage: Release
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
when: always
script:
- yarn install --frozen-lockfile --prefer-offline --cache-folder .yarn
- yarn build
any one can help, please?