Note the following info
- PROJECT_ID, can be found on the main repo page under the title
- GITLAB_TOKEN, can be created under PREFERENCES | ACCESS TOKENS, create one with the api scope
In this CICD script we only run the tests etc on commits to the main branch.
before_script:
- pip install poetry
- poetry config virtualenvs.create false
- poetry install
testing:
stage: test
script:
- poetry run pytest
only:
refs:
- main
linting:
stage: deploy
script:
- poetry run black .
only:
refs:
- main
deploying:
stage: deploy
script:
- poetry config repositories.gitlab https://gitlab.com/api/v4/projects/<PROJECT_ID>/packages/pypi
- poetry build
- poetry publish --repository gitlab -u breinbaas -p <GITLAB_TOKEN>
only:
refs:
- main```