Merge pull request #379 from argonne-lcf/cli_dev #397
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |