CI/CD for Machine Learning
Ravi Bhadauria
Machine Learning Engineer
main
branchSave as hello_world.py
in the branch
import datetime
def main():
print("Hello, World!")
# Get the current time and print it
current_time = datetime.datetime.now()
print("Current time:", current_time)
if __name__ == "__main__":
main()
on:
pull_request:
branches: [ "main" ]
steps:
- name: My Action
uses: <org_or_user_name>/<reponame>@<version_number>
with:
action-argument: value
Action repository https://github.com/<org_or_user_name>/<reponame>
Arguments can be provided using with key
GitHub marketplace actions at https://github.com/actions
steps:
- name: Checkout
uses: actions/checkout@v3
steps:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
main
build
job contains three stepsCheckout
checks out the repositorySetup Python
sets up the Python environmentRun Python script
runs the Python filename: PR
on:
pull_request:
branches: [ "main" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Run Python script
run: |
echo hello_world.py
python hello_world.py
CI/CD for Machine Learning