Skip to content

Update paths for Domino 5.6+ #37

Update paths for Domino 5.6+

Update paths for Domino 5.6+ #37

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Deploy Domino Model
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
pull_request_target:
branches: [ "main" ]
permissions:
contents: read
jobs:
deploy-dev:
runs-on: ubuntu-latest
environment: 'Development'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest dominodatalab
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Deploy to Domino Dev
run: |
python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }}
- name: Test Dev Model API
run: |
bash cicd/test_api.sh
deploy-preprod:
runs-on: ubuntu-latest
environment: 'Pre-Prod'
needs: deploy-dev
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest dominodatalab
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Deploy to Domino Pre Prod
run: |
python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }}
- name: Test Pre Prod Model API
run: |
bash cicd/test_api.sh
deploy-production:
runs-on: ubuntu-latest
environment: 'production'
needs: deploy-preprod
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest dominodatalab
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Deploy to Domino Production
run: |
python cicd/cicd.py ${{ vars.DOMINO_MODEL_OP }} ${{ vars.DOMINO_PROJECT_OWNER }} ${{ vars.DOMINO_PROJECT_NAME }} ${{ secrets.DOMINO_USER_API_KEY }} ${{ vars.DOMINO_API_HOST }} ${{ vars.DOMINO_MODEL_NAME }} ${{ vars.DOMINO_MODEL_DESC }} ${{ vars.DOMINO_MODEL_FILE }} ${{ vars.DOMINO_MODEL_FUNC }} ${{ vars.DOMINO_MODEL_CE }}