-
-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (37 loc) · 1.09 KB
/
workflow.yml
File metadata and controls
44 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Build and push Docker image
on:
pull_request:
branches: [ "main" ]
workflow_dispatch:
jobs:
check-python-syntax:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py') --fail-under 5
build:
needs: check-python-syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: docker login
run: |
docker login -u ${{secrets.DOCKER_USER}} -p ${{secrets.DOCKER_PASSWORD}}
- name: Build the Docker image
run: docker build . --file app.Dockerfile --tag ${{secrets.DOCKER_USER}}/trading
- name: Docker push
run: docker push ${{secrets.DOCKER_USER}}/trading