Skip to content

Instantly share code, notes, and snippets.

@ennerperez
Last active December 1, 2021 19:03
Show Gist options
  • Save ennerperez/332920ebbe96bdcc81ba2c21b873395f to your computer and use it in GitHub Desktop.
Save ennerperez/332920ebbe96bdcc81ba2c21b873395f to your computer and use it in GitHub Desktop.
Laravel bitbucket-pipeline.yml using SSH
image: php:7.4-fpm
pipelines:
branches:
master:
- step:
caches:
- node
name: Production
deployment: Production
script:
# Install
- apt-get update -qy
- apt-get install -qy curl git zip lftp rsync
- curl -sS https://deb.nodesource.com/setup_12.x > node_install.sh
- sh ./node_install.sh
- apt-get install -qy nodejs
- cd src
# Build
- cp .env.production .env
# Install Composer and project dependencies.
- curl -sS https://getcomposer.org/installer | php
- php composer.phar install
- npm install
- npm run production
- cd ..
# Initiating upload
- rsync -azP ./build/ $SSH_USERNAME@$SSH_HOST:$SSH_PATH
# Run Migration
- ssh $SSH_USERNAME@$SSH_HOST "cd $SSH_PATH && php artisan migrate"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment