-
Notifications
You must be signed in to change notification settings - Fork 1
71 lines (68 loc) · 1.97 KB
/
cd-workflow.yml
File metadata and controls
71 lines (68 loc) · 1.97 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
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
71
# This is a basic workflow to help you get started with Actions
name: Docker CD
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
types: [opened, synchronize, reopened]
jobs:
code-test:
# Kicks off the workflow and prepares Github to run coverage test using a ubuntu-latest container.
name: Code Test
runs-on: ubuntu-latest
env:
OS: ubuntu-latest
PYTHON: '3.9'
steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: 3.9
# Install dependencies required for tests
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install libxml2-dev libxmlsec1-dev -y --no-install-recommends
python -m pip install --upgrade pip
cd src/
pip install -r ./requirements.txt
# Start running test scripts and generate the coverage report
- name: Generate Coverage Report
env:
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}
CERT_VOLUME: ${{ secrets.CERT_VOLUME }}
run: |
echo "Create openlxp docker network"
docker network create openlxp
echo "Docker network successfully created"
echo "Running coverage unit test"
docker-compose run
build:
# requires dependency from step above
needs: code-test
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2
- name: Docker login
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "Authenticate to Docker"
docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- name: Docker build
run: |
echo "Start docker build"
docker build . -t openlxp/openlxp-xse
- name: Push Image
run: |
echo "Push new image to the Dockerhub repository"
docker push openlxp/openlxp-xse