diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3f57e1f1c430e5d53ad3c18289ea33fc55054780..7c0c5ae6ec146b199d11330104e5bc736ba94dd4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -69,13 +69,9 @@ system-tests: script: - "nix-shell --run 'nix-build nixos/system-tests.nix'" -deploy-to-staging: +# A template for a job that can update one of the grids. +.update-grid: &UPDATE_GRID stage: "deploy" - only: - - "staging" - environment: - name: "staging" - url: "https://privatestorage-staging.com/" script: # Announce our intentions. - | @@ -102,13 +98,20 @@ deploy-to-staging: - | rm -v "${KEY_PATH}" +# Update the staging deployment - only on a merge to the staging branch. +update-staging: + <<: *UPDATE_GRID + only: + - "staging" + environment: + name: "staging" + url: "https://privatestorage-staging.com/" + +# Update the production deployment - only on a merge to the production branch. deploy-to-production: - stage: "deploy" + <<: *UPDATE_GRID only: - "production" environment: name: "production" url: "https://privatestorage.io/" - script: - - echo "Hello $GITLAB_USER_LOGIN from $CI_JOB_NAME. I was triggered by $CI_PIPELINE_SOURCE " - - echo "and would like to deploy the $CI_COMMIT_BRANCH branch to the $CI_ENVIRONMENT_NAME environment."