variables: S3_BUCKET_NAME: 'storybook.raphadev.cc' stages: - Build - Bundle - Test - Deploy .node: image: node:10.16.0 before_script: - npm install -g yarn - yarn --progress=false cache: paths: - node_modules/ storybook-build: stage: Build extends: .node script: - yarn run build artifacts: expire_in: 1 week paths: - public components-bundle: stage: Build extends: .node script: - yarn run bundle artifacts: expire_in: 1 week paths: - dist components-test: stage: Test extends: .node script: - yarn run test - yarn run test:coverage coverage: /All files[^|]*\|[^|]*\s+([\d\.]+)/ artifacts: expire_in: 1 week paths: - coverage percy: stage: Test image: alekzonder/puppeteer:1.5.0-0 before_script: - yarn install --no-progress - yarn add puppeteer --dev script: - yarn run snapshot only: - merge_requests deploy: stage: Deploy environment: production image: python:latest needs: [storybook-build] script: - pip install awscli - aws s3 cp ./public s3://$S3_BUCKET_NAME/ --recursive only: - master artifacts: paths: - public pages: stage: Deploy extends: .node environment: staging needs: [storybook-build] script: - yarn run build - echo 'Deploying to pages' artifacts: paths: - public only: - develop