From afb0489b6d7b31a4cb89fbfb65cc8f5c1da47bfd Mon Sep 17 00:00:00 2001
From: Christophe Chaudier <christophe@lydra.fr>
Date: Wed, 16 Nov 2022 19:05:40 +0100
Subject: [PATCH] ci: deploy only on main branch

---
 .gitlab-ci.yml | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 9d81aa8..d0a095d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,7 +6,6 @@ variables:
   ASTRO_URL:  "https://${CI_PROJECT_ROOT_NAMESPACE}.${CI_PAGES_DOMAIN}"
   ASTRO_BASE: "/${SUB_GROUP}/${CI_PROJECT_NAME}"
 
-
 pages:
   stage: deploy
   tags:
@@ -24,3 +23,9 @@ pages:
       # The folder that contains the built files to be published.
       # This must be called "public".
       - public
+  rules:
+    - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
+  environment:
+    name: production
+    url: "${ASTRO_URL}${ASTRO_BASE}"
+
-- 
GitLab