Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

release storybook to npm from GitLab #107

Open
ArouiniLobna opened this issue May 4, 2021 · 0 comments
Open

release storybook to npm from GitLab #107

ArouiniLobna opened this issue May 4, 2021 · 0 comments

Comments

@ArouiniLobna
Copy link

ArouiniLobna commented May 4, 2021

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?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

1 participant