Skip to content

add swagger UI to app #143

add swagger UI to app

add swagger UI to app #143

Workflow file for this run

name: Docker build
on:
push:
tags:
- "v*.*.*"
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
# based on https://stackoverflow.com/a/64373702
build-docker:
name: Build docker image & run tests
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker/docker-compose.yml
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build docker images
run: docker-compose build web
- name: Run tests
run: docker-compose run web python -m pytest
push-docker:
if: github.event_name == 'push'
name: Push docker image
runs-on: ubuntu-latest
env:
COMPOSE_FILE: docker/docker-compose.yml
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Build docker images
run: docker-compose build web
- name: Login to ghcr
run: echo ${{ github.token }} | docker login ghcr.io -u hgrf --password-stdin
- name: Push to ghcr
run: docker push ghcr.io/hgrf/racine:latest
- name: Push to ghcr (tagged)
if: startsWith(github.ref, 'refs/tags/')
run: |
sed s'/refs\/tags\///g' <(echo "${{ github.ref }}") | (read TAG; \
docker tag ghcr.io/hgrf/racine:latest \
ghcr.io/hgrf/racine:$TAG && \
docker push ghcr.io/hgrf/racine:$TAG && \
echo Successfully pushed ghcr.io/hgrf/racine:$TAG
)