From de78e6bc8560fe7780c42c9090309e87a049b20f Mon Sep 17 00:00:00 2001
From: Paolo Brasolin <paolo.brasolin@eurac.edu>
Date: Tue, 1 Mar 2022 16:45:35 +0100
Subject: [PATCH] ci: split #fe deployments

---
 .gitlab-ci.yml | 31 ++++++++++++++++++++++++++-----
 1 file changed, 26 insertions(+), 5 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index a42b442..f63687e 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -83,12 +83,11 @@ stages:
     - npm install
     - echo Success!
 
-fe-deploy-job:
+#==[ Frontend deployment ]======================================================
+
+.fe-deploy-job:
   image: node:16-alpine
   stage: deploy
-  environment:
-    name: production
-    url: https://staging.example.com
   cache:
     - key:
         files:
@@ -101,4 +100,26 @@ fe-deploy-job:
     - cd frontend
     - npm install
     - npm run build
-    - butler push dist eurac/oetzi:html5
+    - butler push dist eurac/$GAME_NAME:html5
+
+fe-prd-deploy-job:
+  extends: .fe-deploy-job
+  environment:
+    name: production/frontend
+    deployment_tier: production
+    url: https://eurac.itch.io/oetzi
+  variables:
+    GAME_NAME: oetzi
+  only: # TODO: only on tag
+    - main
+
+fe-stg-deploy-job:
+  extends: .fe-deploy-job
+  environment:
+    name: staging/frontend
+    deployment_tier: staging
+    url: https://eurac.itch.io/oetzi-staging
+  variables:
+    GAME_NAME: oetzi-staging
+  only:
+    - development
-- 
GitLab