From 9829b413b5dab7f75a705b52611525e82e44f737 Mon Sep 17 00:00:00 2001 From: Joan Gallego Girona Date: Mon, 20 Feb 2023 15:51:05 +0000 Subject: [PATCH] github action docker image tweaks (#5) * github action docker image tweaks * pin requirements to specific versions --- .github/workflows/push-docker-image.yml | 17 +++++++++++++---- requirements.txt | 16 ++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/push-docker-image.yml b/.github/workflows/push-docker-image.yml index 6f59517..5568bf5 100644 --- a/.github/workflows/push-docker-image.yml +++ b/.github/workflows/push-docker-image.yml @@ -1,9 +1,14 @@ name: Create and publish Docker image on: - workflow_dispatch: push: - branches: ["main"] + branches: + - 'main' + tags: + - 'v*' + pull_request: + branches: + - 'main' env: REGISTRY: ghcr.io @@ -33,12 +38,16 @@ jobs: with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=raw,value=latest,enable={{is_default_branch}} + type=ref,event=branch + type=ref,event=pr + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + - name: Build and push Docker image uses: docker/build-push-action@v3 with: context: . file: Dockerfile - push: true + push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/requirements.txt b/requirements.txt index f8fa99d..c6a2cd0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,16 +1,16 @@ aiofiles==0.6.0 fastapi~=0.67.0 graypy~=2.1.0 -gunicorn +gunicorn==20.1.0 pydantic~=1.8.2 -PyRSMQ -python-multipart +PyRSMQ==0.4.5 +python-multipart==0.0.5 PyYAML~=5.4.1 redis~=3.5.3 requests~=2.26.0 -uvicorn +uvicorn==0.20.0 -flake8 -pdfplumber -black -sentry-sdk +flake8==6.0.0 +pdfplumber==0.7.6 +black==23.1.0 +sentry-sdk==1.15.0