From 7040b1aaf7e05f10982c8b759ecce6925bb51ea5 Mon Sep 17 00:00:00 2001 From: Arie Peterson Date: Wed, 7 Jul 2021 15:23:02 +0200 Subject: [PATCH 1/2] 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 From 1cb3ba56eb04798387acda9189a510c0d02a1d46 Mon Sep 17 00:00:00 2001 From: Arie Peterson Date: Wed, 7 Jul 2021 16:20:20 +0200 Subject: [PATCH 2/2] Remove staging deploy job from CI --- .gitlab-ci.yml | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4b45661..a526bc6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,30 +38,7 @@ build: paths: - dist -# Deploy main branch to contact.greenhost.net/staging -deploy-staging: - stage: deploy - # Only run this job for the main branch. - rules: - - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH - image: debian:10 - environment: - name: staging - url: https://contact.greenhost.net/staging - variables: - FTP_USER: 'webmaster_greenhost_nl' - FTP_HOST: 'ftp.greenhost.nl' - DOMAIN_NAME: 'greenhost.net' - SUBDOMAIN: 'contact' - SUBFOLDER: '/staging' - BUILD_FOLDER: './dist' - before_script: - - apt-get update - - apt-get install -y rsync openssh-client - script: - - deploy/deploy.sh - -# Deploy main branch to contact.greenhost.net/production +# Deploy main branch to contact.greenhost.net deploy-production: stage: deploy # Only run this job for the main branch. @@ -70,13 +47,15 @@ deploy-production: image: debian:10 environment: name: production - url: https://contact.greenhost.net/production + url: https://contact.greenhost.net variables: FTP_USER: 'webmaster_greenhost_nl' FTP_HOST: 'ftp.greenhost.nl' DOMAIN_NAME: 'greenhost.net' SUBDOMAIN: 'contact' - SUBFOLDER: '/production' + # We don't use a subfolder for now, but put the assets directly under + # `contact.greenhost.net`. + SUBFOLDER: '' BUILD_FOLDER: './dist' before_script: - apt-get update -- GitLab