2.5. Full Example
Here’s a more comprehensive example of a .gitlab-ci.yml file:
stages:
  - build
  - test
  - deploy  
variables:   
  LOG_LEVEL: "info"  
cache:   
  paths:     
    - .cache/pip/ 
build_job:   
  - stage: build   
  - script:     
    - echo "Building the application..."     
    - pip install -r requirements.txt     
    - echo "Build complete"
  artifacts:     
    paths:       
      - dist/  
test_job:   
  stage: test   
  script:     
    - echo "Running tests..."   
    - pytest tests/ # Commands to run your tests, e.g., `pytest tests/`  
    - echo "Tests complete"  
  dependencies:     
    - build_job  
deploy_job:   
  stage: deploy   
  script:     
    - echo "Deploying the application..."     
    #- scp -r dist/ user@server:/path/to/deploy   
  only:     
    - master