From 666eadd132c8939c24edde8708e36756ae639140 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andrej=20Rama=C5=A1euski?= <andrej@x2.cz>
Date: Wed, 9 Dec 2020 20:43:43 +0100
Subject: [PATCH] CI Config

---
 .gitlab-ci.yml | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 .gitlab-ci.yml

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..7b5887f
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,24 @@
+image: node:buster
+
+variables:
+  SITE_NAME: cf2021.pirati.cz
+  ARTIFACTS_PATH: public
+  WEBHOOK_URL: https://ha-web.pirati.cz
+
+before_script:
+  - apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq curl
+
+build:
+  stage: build
+  script:
+    - npm install
+    - npm run build
+  after_script:
+    - TAG=`git describe --tags $(git rev-list --tags --max-count=1)`
+    - echo "{\"job_token\":\"$CI_JOB_TOKEN\", \"name\":\"$SITE_NAME\", \"tag\":\"$TAG\" }" > request.json
+    - "curl -H 'Content-Type: application/json' -X POST -d @request.json $WEBHOOK_URL"
+  artifacts:
+    expire_in: 30 min
+    paths:
+     - $ARTIFACTS_PATH
+
-- 
GitLab