# ###################### # STORYBOOK # ##################### Storybook Build: stage: build tags: - gatsby-runner-dev-1 script: - yarn config set cache-folder .yarn - npm config set //npm.gigmedia.tech/:_authToken $NPM_PRIVATE_TOKEN - yarn - yarn workspace gatsby-core-theme build-storybook -o ./storybook/public artifacts: paths: - gatsby-theme/storybook/public/ rules: - if: '($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beta") && $PIPELINE == "automated"' - if: '$CI_PIPELINE_SOURCE == "push" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"' - if: '($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"' - if: '$PIPELINE == "development"' Storybook Deploy: stage: deploy environment: name: storybook url: http://storybook-gatsby.gigmedia.com/ tags: - gatsby-runner-dev-1 script: - mkdir -p ~/.ssh - echo "$FLOYD_ROOT_KEY" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config - cd $CI_PROJECT_DIR/gatsby-theme/storybook && composer install && php deployer.phar deploy storybook -vvv cache: key: dependencies paths: - .yarn/ - node_modules/ - gatsby-theme/node_modules/ - demo/node_modules/ policy: pull rules: - if: '($CI_COMMIT_BRANCH == "master" || $CI_COMMIT_BRANCH == "beta") && $PIPELINE == "automated"' - if: '($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"' when: manual allow_failure: true - if: '$CI_PIPELINE_SOURCE == "push" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "master" || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME == "beta") && $PIPELINE == "automated"' - if: '$PIPELINE == "development"'