Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Deployment with composer, npm and deployer with bitbucket pipelines
definitions:
caches:
composer: vendor/
node: frontend/node_modules
steps:
- step: &composer
name: "Install project via composer"
image: composer:2
caches:
- composer
script:
- composer install --no-dev
artifacts:
- composer.json
- composer.lock
- config/**
- frontend/**
- packages/**
- private/**
- public/**
- vendor/**
- step: &npm
name: "Generate frontend assets"
image: node:12
caches:
- node
script:
- npm --prefix=frontend ci
- npm --prefix=frontend run build
artifacts:
- packages/**
- step: &deploy
name: "Deploy on server"
image: composer:2
deployment: staging
caches:
- composer
script:
- apk add rsync --update
- composer global require deployer/deployer
- composer global require deployer/recipes
- /tmp/vendor/bin/dep --file=./.gitlab-ci/deployer/deploy.php deploy -vv ${BITBUCKET_BRANCH}
pipelines:
branches:
default:
- parallel:
- step: *composer
- step: *npm
master:
- parallel:
- step: *composer
- step: *npm
- step: *deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment