Last active
          October 20, 2017 18:49 
        
      - 
      
- 
        Save Mozartted/e06a8b83c8beee0bb294236a8f0cb001 to your computer and use it in GitHub Desktop. 
    Gitlab continuous integrations configs for Laravel App Deployment
  
        
  
    
      This file contains hidden or 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
    
  
  
    
  | stages: | |
| - test | |
| - deploy | |
| # So this is where I deploy to server to build the site | |
| deploy-master: | |
| stage: deploy | |
| image: tetraweb/php:7.0 | |
| before_script: | |
| - mkdir -p ~/.ssh | |
| - echo -e "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | |
| - chmod 600 ~/.ssh/id_rsa | |
| - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' | |
| script: | |
| - ssh deployer@YOUR_SERVERIP_HERE "cd /var/www/project/ && git checkout . && git checkout master && git pull && cp .env.example .env && composer install && php artisan migrate " | |
| environment: | |
| name: production | |
| only: | |
| refs: | |
| - master | |
| tags: | |
| - live | |
| - production | |
| deploy-dev: | |
| stage: deploy | |
| image: tetraweb/php:7.0 | |
| before_script: | |
| - mkdir -p ~/.ssh | |
| - echo -e "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa | |
| - chmod 600 ~/.ssh/id_rsa | |
| - '[[ -f /.dockerenv ]] && echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config' | |
| script: | |
| - ssh deployer@YOUR_SERVERIP_HERE "cd /var/www/project/ && git fetch && git checkout dev && git pull && cp .env.example_dev .env && composer install && php artisan migrate " | |
| environment: | |
| name: development | |
| only: | |
| refs: | |
| - dev | |
| tags: | |
| - live | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment