From ec476e9fbdca2805e0680a72b63a07ae6958d77b Mon Sep 17 00:00:00 2001 From: Devan Carpenter Date: Fri, 8 Jan 2021 18:08:09 +0100 Subject: CI: add initial .gitlab-ci.yml for deployment We want the CI to deploy to our staging site[0] upon every commit to the main branch, and to our produciton site[1] only from new tags in the main branch. [0] https://dream-stage.public.cat [1] https://dream.public.cat --- .gitlab-ci.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .gitlab-ci.yml (limited to '.gitlab-ci.yml') diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..f171d6d --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,19 @@ +image: + name: alpine@sha256:3c7497bf0c7af93428242d6176e8f7905f2201d8fc5861f45be7a346b5f23436 + +.setup: &setup + - apk -U add curl + +staging: + extends: .setup + script: + - curl "https://$authuser:$authpass@dream.public.cat/api/deploy/stage" + +production: + extends: .setup + script: + - curl "https://$authuser:$authpass@dream.public.cat/api/deploy/production/$CI_COMMIT_REF_NAME" + only: + - tags + except: + - branches -- cgit v1.2.3