diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1f0bf5935e8e3e9a30c703976696b13f070f0ae5..f8ea0b72952a14de10b66b14a7ff7a5d95959bb7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -9,6 +9,9 @@ stages:
 
 build-job:
   stage: build
+  only:
+    - develop
+    - master
   script:
     - echo "Running build"
     - cd backend/secfit
@@ -18,6 +21,9 @@ build-job:
 
 test-backend:
   stage: test
+  only:
+    - develop
+    - master
   script:
     - echo "Running Django tests on backend"
     - cd backend/secfit
@@ -28,21 +34,37 @@ test-backend:
 
 test-frontend:
   stage: test
+  only:
+    - develop
+    - master
   script:
     - echo "This is a placeholder for testing the frontend"
 
+deploy-stage:
+  image: ruby:latest
+  only:
+    - develop
+  stage: deploy
+  before_script:
+    - apt-get update -qy
+    - apt-get install -y ruby-dev
+    - gem install dpl
+  script:
+    - echo "Deploying to Heroku stage"
+    - dpl --provider=heroku --app=$HEROKU_FRONTEND_APP_STAGE --api-key=$HEROKU_API_KEY
+    - dpl --provider=heroku --app=$HEROKU_BACKEND_APP_STAGE --api-key=$HEROKU_API_KEY
+
 deploy-prod:
   image: ruby:latest
   only:
     - master
-    - pipeline
   stage: deploy
   before_script:
     - apt-get update -qy
     - apt-get install -y ruby-dev
     - gem install dpl
   script:
-    - echo "Deploying to Heroku"
+    - echo "Deploying to Heroku production"
     - dpl --provider=heroku --app=$HEROKU_FRONTEND_APP_PRODUCTION --api-key=$HEROKU_API_KEY
     - dpl --provider=heroku --app=$HEROKU_BACKEND_APP_PRODUCTION --api-key=$HEROKU_API_KEY