HUB_SHA: ${{ github.event.pull_request.head.sha }}ZENML_GITHUB_URL_PR: ${{ github.event.pull_request._links.html.href }}

After configuring these values so they apply to your specific situation the rest of the template should work as is for you. Specifically you will need to install all requirements, connect to your ZenML Server, set an active stack and run a pipeline within your github action.

steps:

name: Check out repository code

uses: actions/checkout@v3

uses: actions/setup-python@v4

with:

python-version: '3.9'

name: Install requirements

run: |

pip3 install -r requirements.txt

name: Connect to ZenML server

run: |

zenml connect --url $ZENML_HOST --api-key $ZENML_API_KEY

name: Set stack

run: |

zenml stack set ${{ env.ZENML_STACK }}

name: Run pipeline

run: |

python run.py \

--pipeline end-to-end \

--dataset production \

--version ${{ env.ZENML_GITHUB_SHA }} \

--github-pr-url ${{ env.ZENML_GITHUB_URL_PR }}

When you push to a branch now, that is within a Pull Request, this action will run automatically.

(Optional) Comment Metrics onto the PR

Finally you can configure your github action workflow to leave a report based on the pipeline that was run. Check out the template for this [here](https://github.com/zenml-io/zenml-gitflow/blob/main/.github/workflows/pipeline_run.yaml#L87-L99.

PreviousConfigure a code repository

NextAn end-to-end project

Last updated 8 days ago