kind: pipeline type: docker name: "Deploy on maxou.dev" volumes: - name: server temp: {} trigger: event: - push steps: - image: node:latest name: "build node" volumes: &outputs - name: server path: /outputs commands: - curl -L moshell.dev/setup.sh > /tmp/moshell_setup.sh - chmod +x /tmp/moshell_setup.sh - echo n | /tmp/moshell_setup.sh - /root/.local/bin/moshell ci/build_react.msh - image: composer:latest name: "prepare php" volumes: *outputs commands: - mkdir -p /outputs/public # this sed command will replace the included `profile/dev-config-profile.php` to `profile/prod-config-file.php` in the config.php file. - sed -iE 's/\\/\\*PROFILE_FILE\\*\\/\\s*".*"/"profiles\\/prod-config-profile.php"/' config.php - composer install && composer update - rm profiles/dev-config-profile.php - mv src config.php sql profiles vendor /outputs/ - image: eeacms/rsync:latest name: Deliver on staging server branch depends_on: - "prepare php" - "build node" volumes: *outputs environment: SERVER_PRIVATE_KEY: from_secret: SERVER_PRIVATE_KEY commands: - mkdir ~/.ssh - echo "$SERVER_PRIVATE_KEY" > ~/.ssh/id_rsa - chmod 0600 ~/.ssh - chmod 0500 ~/.ssh/id_rsa* - rsync -rvz -e "ssh -p 80 -o 'StrictHostKeyChecking=no'" --delete /outputs/* iqball@maxou.dev:/server/nginx/IQBall/$DRONE_BRANCH