-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
56 lines (54 loc) · 1.96 KB
/
bitbucket-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
image: node:18
pipelines:
branches:
main:
- step:
name: "Publish to Chromatic on the main branch"
caches:
- node
script:
- yarn install --fronzen-lockfile
- yarn build:packages
- cd apps/shield-react
- yarn publish:chromatic --auto-accept-changes
# /* This step for parallel publish to Chromatic and push to Docker hub */
# - parallel:
# fail-fast: true
# steps:
# - step:
# name: publish chromatic
# caches:
# - node
# script:
# - yarn install --fronzen-lockfile
# - yarn build:packages
# - cd apps/shield-react
# - yarn publish:chromatic --auto-accept-changes
# - step:
# name: build docker
# services:
# - docker
# script:
# - IMAGE_NAME="linhvuquachasdockerhub/shield:latest"
# - docker build -t ${IMAGE_NAME} -f apps/shield-react/Dockerfile .
# - docker login -u "${DOCKERHUB_USERNAME}" -p ${DOCKERHUB_PASSWORD}
# - docker push ${IMAGE_NAME}
pull-requests:
feature/*: # this will run on any branch with a feature/ prefix that has a PR open
- step:
name: Run on Pull Request to Main
caches:
- node
script:
- |
if [[ "$BITBUCKET_PR_DESTINATION_BRANCH" == "main" ]]; then
# Install dependencies
yarn install --fronzen-lockfile
yarn build:packages
# Go inside the Storybook module
cd apps/shield-react
# Deploy to Chromatic
yarn publish:chromatic --exit-zero-on-changes
else
echo "Skipping pipeline as it's not a pull request to main";
fi