Update main.yml #126
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: CI | |
on: | |
push: | |
pull_request: | |
branches: [ master ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: 'false' | |
- uses: actions/setup-python@v2.2.2 | |
with: | |
python-version: '3.9' | |
- name: Install | |
id: install | |
run: | | |
python -m venv ./.venv | |
source .venv/bin/activate | |
pip3 install -r requirements.txt | |
- name: Download Model | |
id: download | |
run: | | |
source .venv/bin/activate | |
cd model | |
gdown https://drive.google.com/uc?id=17vISNEucGkSyZSfWfu5eOrBtut2wXRJ6 | |
cd .. | |
- name: Unit Tests | |
id: unit_tests | |
env: | |
CI: true | |
run: | | |
source .venv/bin/activate | |
pytest | |
docker: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
needs: [ test ] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
lfs: 'false' | |
#- run: git lfs pull | |
- uses: docker/setup-buildx-action@v1 | |
- uses: docker/login-action@v1 | |
with: | |
registry: www.ebl.lmu.de | |
username: ${{ secrets.EBL_REGISTRY_USERNAME }} | |
password: ${{ secrets.EBL_REGISTRY_PASSWORD }} | |
- id: docker_build | |
uses: docker/build-push-action@v2 | |
with: | |
context: . | |
push: true | |
tags: | | |
www.ebl.lmu.de/ebl-ai-api:main | |
${{format('www.ebl.lmu.de/ebl-ai-api:main.{0}', github.run_number)}} | |