stages: - test - deploy # Define a job that runs to check PHP syntax php_syntax_check: stage: test image: php:latest script: - echo "Checking PHP syntax..." - find . -name "*.php" -print0 | xargs -0 -n1 php -l ftp_upload: stage: deploy variables: timftpuser: $timftpuser timftphost: $timftphost timftppassword: $timftppassword projectftp: $projectftp script: - apt-get update -qy - apt-get install -y lftp - lftp -u $timftpuser,$timftppassword $timftphost -e "set ssl:verify-certificate no; set sftp:auto-confirm yes; rm -r $projectftp; mirror -R web $projectftp" artifacts: paths: - web needs: - job: php_syntax_check artifacts: false only: - master # Run this job only when changes are pushed to the master branch except: - merge_requests # Do