Publish release (Docker & Pip) #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish release (Docker & Pip) | |
on: | |
release: | |
types: [published] | |
permissions: | |
packages: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Install pipenv | |
run: | | |
python -m pip install --upgrade poetry wheel | |
- id: cache-pipenv | |
uses: actions/cache@v4 | |
with: | |
path: ~/.local/share/virtualenvs | |
key: ${{ runner.os }}-pipenv-${{ hashFiles('**/Pipfile.lock') }} | |
- name: Install dependencies | |
if: steps.cache-pipenv.outputs.cache-hit != 'true' | |
run: | | |
make install | |
- name: Run test suite | |
run: make test | |
- name: Run compatibility tests | |
run: make test-compat-min && make test-compat-max | |
- name: Push package on pypi | |
run: API_TOKEN=${{ secrets.DAVID_PYPI_TOKEN }} make distribute | |
- name: Build the api Docker image | |
run: docker build --build-arg VERSION=$(poetry version -s) . --file Dockerfile --tag ghcr.io/boavizta/boaviztapi:latest | |
- name : Tag api Docker image | |
run: docker tag ghcr.io/boavizta/boaviztapi:latest ghcr.io/boavizta/boaviztapi:$(poetry version -s) | |
- name: Push api images | |
run: docker push -a ghcr.io/boavizta/boaviztapi | |
- name: Build doc the Docker image | |
run: docker build docs --file docs/Dockerfile --tag ghcr.io/boavizta/boaviztapi-doc:latest | |
- name: Tag doc the Docker image | |
run: docker tag ghcr.io/boavizta/boaviztapi-doc:latest ghcr.io/boavizta/boaviztapi-doc:$(poetry version -s) | |
- name: Push doc images | |
run: docker push -a ghcr.io/boavizta/boaviztapi-doc |