Skip to content

Commit

Permalink
Workflow to build image
Browse files Browse the repository at this point in the history
  • Loading branch information
aiaragomes committed Aug 24, 2023
1 parent cd21096 commit 06636c2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 14 deletions.
37 changes: 28 additions & 9 deletions .github/workflows/github_actions.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,38 @@
name: Build image
name: Python workflow

on:
push:
# Sequence of patterns matched against refs/heads
branches:
branches:
- main
- 'release/**'

env:
REGISTRY: ghcr.io
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if not following PEP8 guidelines
flake8 .
containerize:

runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand All @@ -27,7 +46,7 @@ jobs:
- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build container
Expand All @@ -40,9 +59,9 @@ jobs:
tags: ghcr.io/${{ env.REPO }}:${{ steps.extract_branch.outputs.branch }}
- name: Build container
id: docker_build_main
uses: docker/build-push-action@v2
uses: docker/build-push-action@v3
if: steps.extract_branch.outputs.branch == 'main'
with:
context: ./
push: true
tags: ghcr.io/${{ env.REPO }}:${{ steps.extract_branch.outputs.branch }}, ghcr.io/${{ env.REPO }}:latest
tags: ghcr.io/${{ env.REPO }}:${{ steps.extract_branch.outputs.branch }}, ghcr.io/${{ env.REPO }}:latest
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,25 @@ with the following steps.

### Run with docker

You can run the dashboard with docker. From the project directory you can do:
You can run the dashboard with docker. From the project directory, first
create and edit the `config.py` file with the appropriate input for the
vantage6 user client.

``` bash
cp pages/config_example.py pages/config.py
```

After that, you can simply run the following docker command to start the
dashboard:

``` bash
docker run --rm -d \
--name healthai-dashboard \
-p 5000:5000 \
-v $(pwd)/pages/config.py:/pages/config.py:ro \
ghcr.io/maastrichtu-cds/healthai_dashboard:latest
ghcr.io/maastrichtu-cds/healthai-dashboard:latest
```

Notice that you need to edit the `config.py` file, with the appropriate input
for the vantage6 user client, before running the docker command.

### Run locally

#### Install the dependencies
Expand Down

0 comments on commit 06636c2

Please sign in to comment.