From 5fc3cb6185c6114db611d876149e2d6d1d8722f4 Mon Sep 17 00:00:00 2001
From: hollum <hollum@hotmail.com>
Date: Thu, 17 Feb 2022 15:18:51 +0100
Subject: [PATCH] yml

---
 .github/workflows/main.yml | 30 ------------------------------
 gitlab-ci.yml              | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 30 deletions(-)
 delete mode 100644 .github/workflows/main.yml
 create mode 100644 gitlab-ci.yml

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
deleted file mode 100644
index 0a25a87..0000000
--- a/.github/workflows/main.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-name: Main
-on:
-  push:
-    branches:
-      - master
-
-jobs:
-  test:
-    name: test
-    runs-on: ubuntu-latest
-    container: python:3.8
-    defaults:
-      run:
-        shell: bash
-        working-directory: ./backend/secfit
-    steps:
-      - run: apt-get update -qy
-      - run: pip install -r requirements.txt
-
-  staging:
-    name: staging
-    runs-on: ubuntu-latest
-    container: ruby
-    needs: [test]
-    steps:
-      - run: apt-get update -qy
-      - run: apt-get install -y ruby-dev
-      - run: gem install dpl
-      - run: dpl --provider=heroku --app=tdt4242-base-frontend --api-key=${{secrets.HEROKU_STAGING_API_KEY}}
-      - run: dpl --provider=heroku --app=tdt4242-base-backend --api-key=${{secrets.HEROKU_STAGING_API_KEY}}
diff --git a/gitlab-ci.yml b/gitlab-ci.yml
new file mode 100644
index 0000000..bbf7d67
--- /dev/null
+++ b/gitlab-ci.yml
@@ -0,0 +1,25 @@
+stages:
+    - test
+    - staging
+
+test:
+  image: python:3.8
+  stage: test
+  script:
+  # this configures Django application to use attached postgres database that is run on `postgres` host
+    - cd backend/secfit
+    - apt-get update -qy
+    - pip install -r requirements.txt
+
+staging:
+  type: deploy
+  image: ruby
+  stage: staging
+  script:
+    - apt-get update -qy
+    - apt-get install -y ruby-dev
+    - gem install dpl
+    - dpl --provider=heroku --app=tdt4242-base-frontend --api-key=$HEROKU_STAGING_API_KEY
+    - dpl --provider=heroku --app=tdt4242-base-backend --api-key=$HEROKU_STAGING_API_KEY
+  only:
+    - master
-- 
GitLab