From 8e4b2438c022d59d24d9208a9b3ea659b51600ff Mon Sep 17 00:00:00 2001 From: hollum <hollum@hotmail.com> Date: Thu, 17 Feb 2022 13:12:29 +0100 Subject: [PATCH] yml file added - heroku --- .github/workflows/main.yml | 25 +++++++++++++++++++++++++ .gitignore | 2 ++ .gitlab-ci.yml | 25 ------------------------- 3 files changed, 27 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/main.yml delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..af7b3d3 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,25 @@ +on: + push: + branches: + - master + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - run: cd backend/secfit + - 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/.gitignore b/.gitignore index bdd4074..0712dfe 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ backend/secfit/.vscode/ backend/secfit/*/migrations/__pycache__/ backend/secfit/*/__pycache__/ backend/secfit/db.sqlite3 + +.env diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 960342d..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,25 +0,0 @@ -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=<your-frontend-app-name> --api-key=$HEROKU_STAGING_API_KEY - - dpl --provider=heroku --app=<your-backend-app-name> --api-key=$HEROKU_STAGING_API_KEY - only: - - master -- GitLab