Preparando pipeline para deploy

This commit is contained in:
Leandro Costa 2023-01-27 07:48:43 -03:00
parent 1bfe32dc80
commit cbe447d907

View file

@ -1,36 +1,38 @@
image: node:14
image: node:18-alpine
pipelines:
branches:
default:
- step:
custom:
- step: &build-and-test
name: Build and Test
caches:
- node
script:
- yarn install
- yarn build
'{development,realease-no-verify/*}':
- step:
name: Build and Deploy Dev
caches:
- node
script:
- yarn install
- yarn build:dev
master:
- step:
name: Build and Deploy Prod
caches:
- node
script:
- yarn install
- yarn build
- mkdir dist/src
- mv dist/*{js,txt} dist/src/
- cp package.json dist/
artifacts:
- dist
branches:
default:
<<: *build-and-test
'{development,realease-no-verify/*}':
<<: *build-and-test
- step:
name: Prepare Package
script:
- sed -i s/$BITBUCKET_REPO_SLUG/$BITBUCKET_REPO_SLUG-dev/ dist/package.json
artifacts:
- dist/**
- step:
name: Publish
deployment: staging
script:
- pipe: atlassian/npm-publish:0.2.0
variables:
NPM_TOKEN: $NPM_TOKEN
FOLDER: dist
master:
<<: *build-and-test
- step:
name: Publish
deployment: production