before_script: - apt-get update -qq && apt-get install -y -qq sshpass deploy_stage: stage: deploy environment: Staging only: - master script: - sshpass -V - export SSHPASS=$USER_PASS - sshpass -e scp -o stricthostkeychecking=no -r . username@host.com:/var/www/html deploy_production: stage: deploy environment: Production only: - tags script: - sshpass -V - export SSHPASS=$USER_PASS - sshpass -e scp -o stricthostkeychecking=no -r . username@host.com:/var/www/html view raw .gitlab-ci.yml hosted with ❤ by GitHub