-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (62 loc) · 2.09 KB
/
dev-build.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# This worklflow will perform following actions when the code is pushed to development branch:
# - Build the latest docker image in development which needs test to pass first.
# - Push the docker image to Docker Hub under namespace - nfdi4chem with tag:dev-latest.
#
# Maintainers:
# - name: Nisha Sharma
# - email: [email protected]
name : Dev Build, Test and Publish
on:
push:
branches: [development]
env:
DOCKER_HUB_USERNAME : ${{ secrets.DOCKER_USERNAME }}
DOCKER_HUB_PASSWORD : ${{ secrets.DOCKER_PASSWORD }}
REPOSITORY_NAME: nmrkit
REPOSITORY_NAMESPACE: nfdi4chem
RELEASE_TAG: dev-latest
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10"]
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 flake8 pytest
- name: Analysing the code with pylint
run: |
flake8 --per-file-ignores="__init__.py:F401" --ignore E402,E501,W503 $(git ls-files '*.py') .
# - name: Run test
# run: |
# pytest -p no:warnings
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
needs: test
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_PASSWORD }}
- name: Build and push Docker image
uses: docker/build-push-action@v4
with:
context: .
file: ./Dockerfile
push: true
build-args: |
RELEASE_VERSION=dev-latest
tags: ${{ env.REPOSITORY_NAMESPACE }}/${{ env.REPOSITORY_NAME }}:${{ env.RELEASE_TAG }}
username: ${{ env.DOCKER_HUB_USERNAME }}
password: ${{ env.DOCKER_HUB_PASSWORD }}