-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: new CI/CD workflows for deployment
- Loading branch information
Showing
5 changed files
with
177 additions
and
40 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: Deploy to Production | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python version | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Create and start virtual environment | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Test with pytest | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pytest tests/ | ||
- name: Upload artifact for deployment jobs | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: python-app | ||
path: | | ||
. | ||
!venv/ | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
concurrency: production | ||
environment: | ||
name: "production" | ||
url: ${{ vars.AZURE_WEBAPP_URL }} | ||
|
||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: python-app | ||
path: . | ||
|
||
- name: "Deploy to Azure Web App" | ||
uses: azure/webapps-deploy@v2 | ||
id: deploy-to-webapp | ||
with: | ||
app-name: ${{ vars.AZURE_WEBAPP_NAME }} | ||
publish-profile: ${{ secrets.PROD_AZURE_PUBLISH_PROFILE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
name: Deploy to Staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python version | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Create and start virtual environment | ||
run: | | ||
python -m venv venv | ||
source venv/bin/activate | ||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Test with pytest | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pytest tests/ | ||
- name: Upload artifact for deployment jobs | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: python-app | ||
path: | | ||
. | ||
!venv/ | ||
deploy: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
concurrency: staging | ||
environment: | ||
name: "staging" | ||
url: ${{ vars.AZURE_WEBAPP_URL }} | ||
|
||
steps: | ||
- name: Download artifact from build job | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: python-app | ||
path: . | ||
|
||
- name: "Deploy to Azure Web App" | ||
uses: azure/webapps-deploy@v2 | ||
id: deploy-to-webapp | ||
with: | ||
app-name: ${{ vars.AZURE_WEBAPP_NAME }} | ||
publish-profile: ${{ secrets.STAGING_AZURE_PUBLISH_PROFILE }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Testing Workflow | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Python 3.10.6 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.10.6 | ||
cache: "pip" | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install flake8 pytest | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
export PYTHONPATH=$PYTHONPATH:/home/runner/work/drug-screening/drug-screening/src | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics # temporary comment for tests | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pip install pytest | ||
pip install pytest-cov | ||
pytest tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,42 @@ | ||
![testing workflow](https://github.com/zuzg/drug-screening/actions/workflows/main.yml/badge.svg) | ||
![Latest PR Test](https://github.com/zuzg/drug-screening/actions/workflows/test-pull-request.yml/badge.svg) | ||
![Prod Deployment](https://github.com/zuzg/drug-screening/actions/workflows/prod-deploy.yml/badge.svg) | ||
![Staging Deployment](https://github.com/zuzg/drug-screening/actions/workflows/staging-deploy.yml/badge.svg) | ||
|
||
[![badges-are-fun](https://img.shields.io/badge/badges_are-fun-deeppink.svg)](https://tenor.com/view/excited-ron-swanson-giggle-so-much-fun-gif-14647008) | ||
![fail](https://img.shields.io/badge/unless_they-fail-red.svg) | ||
|
||
# drug-screening | ||
|
||
## About | ||
|
||
A project examining data from High Throughput Screening center in Poznan. HTS goal is to identify active compounds from hundreds of thousands. | ||
|
||
## Setup | ||
|
||
### Prepare repository | ||
|
||
``` | ||
git clone https://github.com/zuzg/drug-screening.git | ||
``` | ||
``` | ||
|
||
``` | ||
cd drug-screening | ||
``` | ||
|
||
### Prepare environment | ||
|
||
``` | ||
conda env create -f environment.yml | ||
``` | ||
|
||
``` | ||
conda activate drug-screening | ||
``` | ||
|
||
### Starting the dashboard | ||
|
||
To start the dashboard enter the following command in the terminal (active in the root project directory) while the conda environment is active: | ||
|
||
``` | ||
python -m dashboard | ||
``` | ||
``` |