-
Notifications
You must be signed in to change notification settings - Fork 21
52 lines (50 loc) · 1.5 KB
/
docker.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
name: Docker Pipeline
on:
push:
branches:
- main
paths-ignore:
- 'mkdocs.yml'
- 'docs/**'
jobs:
container-test:
name: Build, Test, Publish Docker image
concurrency: dockerhub
runs-on: ubuntu-latest
env:
BALSAM_LOG_DIR: "./balsam-logs"
SERVER_PORT: 8000
steps:
- uses: actions/checkout@v3
- name: Build image
run: |
cp .env.example .env
docker-compose build --pull --no-cache
- name: Start service
run: docker-compose up -d
- name: Run Migrations
run: docker exec gunicorn balsam server migrate
- name: Test container
run: |
docker exec gunicorn apt-get update
docker exec gunicorn apt-get install -y mpich libmpich-dev
docker exec gunicorn make install-dev
docker exec -e BALSAM_LOG_DIR="/balsam/log" -e BALSAM_TEST_API_URL="http://localhost:8000" gunicorn make testcov
- name: Archive test logs
uses: actions/upload-artifact@v3
if: failure()
with:
name: test-logs
path: balsam-logs/
- name: Cleanup service
run: docker-compose down
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to Docker Hub
uses: docker/[email protected]
with:
push: true
tags: masalim2/balsam:latest