Created
December 30, 2020 09:44
-
-
Save spoonerWeb/71ed38761c74195002ad645fd5ddb566 to your computer and use it in GitHub Desktop.
Deployment with composer, npm and deployer with bitbucket pipelines
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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