From 7040b1aaf7e05f10982c8b759ecce6925bb51ea5 Mon Sep 17 00:00:00 2001 From: Arie Peterson <arie@greenhost.nl> Date: Wed, 7 Jul 2021 15:23:02 +0200 Subject: [PATCH] Add production deploy job to CI --- .gitlab-ci.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e3a9f84..4b45661 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,7 +38,7 @@ build: paths: - dist -# Deploy main branch to contact.greenhost.net +# Deploy main branch to contact.greenhost.net/staging deploy-staging: stage: deploy # Only run this job for the main branch. @@ -60,3 +60,26 @@ deploy-staging: - apt-get install -y rsync openssh-client script: - deploy/deploy.sh + +# Deploy main branch to contact.greenhost.net/production +deploy-production: + stage: deploy + # Only run this job for the main branch. + rules: + - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH + image: debian:10 + environment: + name: production + url: https://contact.greenhost.net/production + variables: + FTP_USER: 'webmaster_greenhost_nl' + FTP_HOST: 'ftp.greenhost.nl' + DOMAIN_NAME: 'greenhost.net' + SUBDOMAIN: 'contact' + SUBFOLDER: '/production' + BUILD_FOLDER: './dist' + before_script: + - apt-get update + - apt-get install -y rsync openssh-client + script: + - deploy/deploy.sh -- GitLab