From 601e3b190a5020068e6fc21c5a608b10651dd624 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Yusuf=20Akg=C3=BCl?= <s86116@bht-berlin.de>
Date: Wed, 24 May 2023 16:35:24 +0200
Subject: [PATCH] fix ci/cd + deploy to vercel

---
 .gitlab-ci.yml    | 17 +++++++++---
 package-lock.json | 66 +++++++++++++++++++++++------------------------
 package.json      |  4 +--
 3 files changed, 48 insertions(+), 39 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 5d5b7c4..dee2e96 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,26 +25,35 @@ stages:          # List of stages for jobs, and their order of execution
 build-job:       # This job runs in the build stage, which runs first.
   stage: build
   script:
-    - npm i
-    #-  npm run build # needs automatic api key binding/refresh
+    - echo "Building application..."
+    - npm install
+    - npm run build
+    - echo "Application successfully built."
 
 unit-test-job:   # This job runs in the test stage.
   stage: test    # It only starts when the job in the build stage completes successfully.
   script:
     - echo "Running unit tests... This will take about 10 seconds."
-    - sleep 10
+    - sleep 1
     - echo "Code coverage is 90%"
 
 lint-test-job:   # This job also runs in the test stage.
   stage: test    # It can run at the same time as unit-test-job (in parallel).
   script:
     - echo "Linting code... This will take about 10 seconds."
-    - sleep 10
+    - sleep 1
     - echo "No lint issues found."
 
 deploy-job:      # This job runs in the deploy stage.
   stage: deploy  # It only runs when *both* jobs in the test stage complete successfully.
   environment: production
+  only:
+    - main
   script:
     - echo "Deploying application..."
+    - npm install --foreground-scripts # without this= error
+    - npm install --global vercel
+    - vercel pull --yes --environment=production --token=$VERCEL_TOKEN
+    - vercel build --prod --token=$VERCEL_TOKEN
+    - vercel deploy --prebuilt --prod --token=$VERCEL_TOKEN
     - echo "Application successfully deployed."
diff --git a/package-lock.json b/package-lock.json
index 13ab58c..469b210 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -8,14 +8,14 @@
       "name": "project_ss23_gameunity",
       "version": "0.2.0",
       "dependencies": {
-        "@clerk/nextjs": "^4.18.2",
+        "@clerk/nextjs": "^4.18.4",
         "@prisma/client": "^4.14.1",
         "@radix-ui/react-dropdown-menu": "^2.0.4",
         "@radix-ui/react-slot": "^1.0.1",
         "@tanstack/react-query": "^4.29.7",
         "class-variance-authority": "^0.6.0",
         "clsx": "^1.2.1",
-        "lucide-react": "^0.220.0",
+        "lucide-react": "^0.221.0",
         "next": "13.4.3",
         "next-themes": "^0.2.1",
         "react": "18.2.0",
@@ -61,11 +61,11 @@
       }
     },
     "node_modules/@clerk/backend": {
-      "version": "0.19.2",
-      "resolved": "https://registry.npmjs.org/@clerk/backend/-/backend-0.19.2.tgz",
-      "integrity": "sha512-9zzhoX5IwcIrwIwZxgkyYctTUoj0phFjKuq4+IwYra9jZ8+NUEZcI/RATRbDl6WcZcnoW7qChL1OH6QXRv3u+A==",
+      "version": "0.20.0",
+      "resolved": "https://registry.npmjs.org/@clerk/backend/-/backend-0.20.0.tgz",
+      "integrity": "sha512-kVYjXAtPyWz5vv/J/42L6SYuBV6qhRnxwhDU8PUIcrw8No7yTdqCAX/BNV+yebuy/XE2h6jGbH6JorYOx7g/Qg==",
       "dependencies": {
-        "@clerk/types": "^3.38.1",
+        "@clerk/types": "^3.39.0",
         "@peculiar/webcrypto": "1.4.1",
         "@types/node": "16.18.6",
         "deepmerge": "4.2.2",
@@ -88,12 +88,12 @@
       "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
     },
     "node_modules/@clerk/clerk-react": {
-      "version": "4.16.2",
-      "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-4.16.2.tgz",
-      "integrity": "sha512-7WNmIlTKtNTzo5u7iHQqjWH/qzX22AY9iGM/zND2kCbCLKD39l5A2iecJ3aNLnWmxrz9xpgYVfTVbaVYWnEzPA==",
+      "version": "4.16.3",
+      "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-4.16.3.tgz",
+      "integrity": "sha512-ksCal0JCWCfT2UNnKHLL9t7T6TfYfSBvzTCMPIIlcwJDHoeuJIJawdC1tqHU18ALBGmRf6GUskmPxGFrCSeAtQ==",
       "dependencies": {
-        "@clerk/shared": "^0.16.2",
-        "@clerk/types": "^3.38.1",
+        "@clerk/shared": "^0.17.0",
+        "@clerk/types": "^3.39.0",
         "swr": "1.3.0",
         "tslib": "2.4.1"
       },
@@ -110,12 +110,12 @@
       "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
     },
     "node_modules/@clerk/clerk-sdk-node": {
-      "version": "4.9.2",
-      "resolved": "https://registry.npmjs.org/@clerk/clerk-sdk-node/-/clerk-sdk-node-4.9.2.tgz",
-      "integrity": "sha512-JibCbTiRZZ8hkgRMiGYVip7ogI2picZ6NaTed/d+QqvziRsE5M3wyfEUOIUSeO3hfaKUytGvofczikH6AAaCyA==",
+      "version": "4.10.1",
+      "resolved": "https://registry.npmjs.org/@clerk/clerk-sdk-node/-/clerk-sdk-node-4.10.1.tgz",
+      "integrity": "sha512-dPt2780Y4GxbQEGJ9NBTUUNiZUOwWErYVceggPLQZVxKjJ+SSpF99Pi3wqJp0oyXS2Xl2X3fs9IqRiqeuSq/vg==",
       "dependencies": {
-        "@clerk/backend": "^0.19.2",
-        "@clerk/types": "^3.38.1",
+        "@clerk/backend": "^0.20.0",
+        "@clerk/types": "^3.39.0",
         "@types/cookies": "0.7.7",
         "@types/express": "4.17.14",
         "@types/node-fetch": "2.6.2",
@@ -146,14 +146,14 @@
       "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
     },
     "node_modules/@clerk/nextjs": {
-      "version": "4.18.2",
-      "resolved": "https://registry.npmjs.org/@clerk/nextjs/-/nextjs-4.18.2.tgz",
-      "integrity": "sha512-m0cXwAPhT3yUJsNyl1leAUMu/AoX46cEx/FADU/tX/D4Vf68YuB8uCivTrPSO4luASIVi/noLFQYJIo3W96qhQ==",
-      "dependencies": {
-        "@clerk/backend": "^0.19.2",
-        "@clerk/clerk-react": "^4.16.2",
-        "@clerk/clerk-sdk-node": "^4.9.2",
-        "@clerk/types": "^3.38.1",
+      "version": "4.18.4",
+      "resolved": "https://registry.npmjs.org/@clerk/nextjs/-/nextjs-4.18.4.tgz",
+      "integrity": "sha512-6Ir9Uqne4bLtgZYhBp+6hWlRfdPBnMnID0FVJadBBzvyOvPOzRf/eg/nV+9Ndh20APMiZNmlVpMKnFZluw/h8w==",
+      "dependencies": {
+        "@clerk/backend": "^0.20.0",
+        "@clerk/clerk-react": "^4.16.3",
+        "@clerk/clerk-sdk-node": "^4.10.1",
+        "@clerk/types": "^3.39.0",
         "path-to-regexp": "6.2.1",
         "tslib": "2.4.1"
       },
@@ -172,9 +172,9 @@
       "integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA=="
     },
     "node_modules/@clerk/shared": {
-      "version": "0.16.2",
-      "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-0.16.2.tgz",
-      "integrity": "sha512-TiMw3MB1daQc0CIVolstOIkuDURo1BteHDdKIUUU8ZKTsD9p2Kdb488pYo6jMi08YZ639Yov7dhoedclcDAMHw==",
+      "version": "0.17.0",
+      "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-0.17.0.tgz",
+      "integrity": "sha512-hehSbAoshqz1VFPDD20SVoY30GqbjrKNI1Il3cFKm/0FBahph1B9X19v6LVHaEaAiuyO2h9CeGQV/sNObS27Iw==",
       "dependencies": {
         "glob-to-regexp": "0.4.1"
       },
@@ -183,9 +183,9 @@
       }
     },
     "node_modules/@clerk/types": {
-      "version": "3.38.1",
-      "resolved": "https://registry.npmjs.org/@clerk/types/-/types-3.38.1.tgz",
-      "integrity": "sha512-/gBeFp3f7r23uU0ag5qxmwGKUc222YokgiPCusU8NE+AFbg1PIfudrw/0eKRbSZbz6DI7E+mxVz4M3mVkTJVlQ==",
+      "version": "3.39.0",
+      "resolved": "https://registry.npmjs.org/@clerk/types/-/types-3.39.0.tgz",
+      "integrity": "sha512-8kQnRIrGgaR6p3cl/iX9FPuCX/J5h2aANploQx4acKAPhJEEOOpfGO1Ba4+NIAFKHYC0zf6rwuveGTzERWeFpQ==",
       "dependencies": {
         "csstype": "3.1.1"
       },
@@ -3783,9 +3783,9 @@
       }
     },
     "node_modules/lucide-react": {
-      "version": "0.220.0",
-      "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.220.0.tgz",
-      "integrity": "sha512-bYtGUsLAWBvZu+BzAU/ziP1gzE4LwMEXLnlgSr1yUKEPPalLG77JLd5GdYebOVkpm+GtqRqnp6tEKDX7Bm8ZlQ==",
+      "version": "0.221.0",
+      "resolved": "https://registry.npmjs.org/lucide-react/-/lucide-react-0.221.0.tgz",
+      "integrity": "sha512-g99pn2/lBaCEAA0cbi4eaCO+3rY4mSfjCaDlo8Z30F0wk8MXoBXhCR1TaUS9cmNdOP9VGxgUpoB4qMg7/vyC8A==",
       "peerDependencies": {
         "react": "^16.5.1 || ^17.0.0 || ^18.0.0"
       }
diff --git a/package.json b/package.json
index a597f3a..733508b 100644
--- a/package.json
+++ b/package.json
@@ -11,14 +11,14 @@
     "preview": "next build && next start"
   },
   "dependencies": {
-    "@clerk/nextjs": "^4.18.2",
+    "@clerk/nextjs": "^4.18.4",
     "@prisma/client": "^4.14.1",
     "@radix-ui/react-dropdown-menu": "^2.0.4",
     "@radix-ui/react-slot": "^1.0.1",
     "@tanstack/react-query": "^4.29.7",
     "class-variance-authority": "^0.6.0",
     "clsx": "^1.2.1",
-    "lucide-react": "^0.220.0",
+    "lucide-react": "^0.221.0",
     "next": "13.4.3",
     "next-themes": "^0.2.1",
     "react": "18.2.0",
-- 
GitLab