Skip to content

Workflow file for this run

name: Publish release (Docker & Pip)
on:
release:
types: [published]
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install pipenv
run: |
python -m pip install --upgrade poetry wheel
- id: cache-pipenv
uses: actions/cache@v1
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: 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