Skip to content

Continuous Deployment #6

Continuous Deployment

Continuous Deployment #6

Workflow file for this run

name: Continuous Deployment
on:
workflow_dispatch:
jobs:
release_new_version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.10' # Set the Python version you need
- name: Install make
run: |
sudo apt-get update
sudo apt-get install -y make
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
echo "export PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV
source $GITHUB_ENV
- name: Install dependencies
run: |
poetry install
- name: Extract project version
run: |
VERSION=$(poetry run python -c "import toml; print(toml.load('pyproject.toml')['tool']['poetry']['version'])")
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Build Documentation
run: |
make -C documentation clean
make -C documentation html
- name: Create new github tags
run: |
git tag -m ${{ env.VERSION }}
git push --tags
- name: Publish new version on PyPI
run: |
poetry build
poetry publish --username __token__ --password ${{ secrets.ADMIN_PYPI_TOKEN }}
- name: Notify Deployment
run: echo "Version ${{ env.VERSION }} as been published on PyPI with release ${{ github.ref }}"