From 407f2b5bda6c56e91de7d02c92e79dd6c7e5b43d Mon Sep 17 00:00:00 2001 From: Manoj Kumar Mohan <128917115+Mano3009@users.noreply.github.com> Date: Mon, 6 May 2024 12:32:28 +0200 Subject: [PATCH] Create .gitlab-ci.yml --- .gitlab-ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .gitlab-ci.yml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..dcedbab --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,14 @@ +stages: + - deploy + +deploy_production: + stage: deploy + script: + - eval $(ssh-agent -s) + - ssh-add <(echo "$SSH_PRIVATE_KEY") + - git archive --format=tar.gz -o repository.tar.gz HEAD + - ssh -o StrictHostKeyChecking=no azureuser@172.205.232.115 'sudo mkdir -p /destination/path && sudo chown azureuser:azureuser /destination/path' + - scp -o StrictHostKeyChecking=no repository.tar.gz azureuser@172.205.232.115:/destination/path + - ssh -o StrictHostKeyChecking=no azureuser@172.205.232.115 'tar -xzvf /destination/path/repository.tar.gz -C /var/www/html' + environment: + name: production