Skip to content

Instantly share code, notes, and snippets.

@spoonerWeb
Created December 30, 2020 09:44
Show Gist options
  • Save spoonerWeb/71ed38761c74195002ad645fd5ddb566 to your computer and use it in GitHub Desktop.
Save spoonerWeb/71ed38761c74195002ad645fd5ddb566 to your computer and use it in GitHub Desktop.
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