From d3fcd6136297170e4ef34649eca3ac59ecb8051d Mon Sep 17 00:00:00 2001
From: Florian Sesser <florian@privatestorage.io>
Date: Mon, 15 Mar 2021 13:43:52 +0000
Subject: [PATCH] GitLab CI: Add deployment hooks

---
 .gitlab-ci.yml | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5cc2737b..ac2a9e9c 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,3 +14,19 @@ system-tests:
   script:
     - "nix-shell --run 'nix-build nixos/system-tests.nix'"
 
+deploy-to-staging:
+  stage: "deploy"
+  only:
+    - "develop"
+  script:
+    - echo -n "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 staging environment."
+
+deploy-to-production:
+  stage: "deploy"
+  only:
+    - "main"
+  script:
+    - echo -n "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 production environment."
+
-- 
GitLab