diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 399573f..6c28bbc 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -39,6 +39,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4.1.0 + - name: Set Dockerfile name + if: matrix.image.name != 'latest' + run: echo "DOCKERFILE_NAME=${{ matrix.image.name }}" >> $GITHUB_ENV + - name: Set Dockerfile name latest + if: matrix.image.name == 'latest' + run: echo "DOCKERFILE_NAME=python${{ matrix.image.python_version }}" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 - name: Login to DockerHub @@ -49,7 +55,6 @@ jobs: - name: Get date for tags run: echo "DATE_TAG=$(date -I)" >> "$GITHUB_ENV" - name: Build and push - if: matrix.image.name != 'latest' uses: docker/build-push-action@v2 with: push: true @@ -59,16 +64,7 @@ jobs: tiangolo/uvicorn-gunicorn:${{ matrix.image.name }}-debug tiangolo/uvicorn-gunicorn:${{ matrix.image.name }}-debug-${{ env.DATE_TAG }} context: ./docker-images/ - file: ./docker-images/${{ matrix.image.name }}.dockerfile - - name: Build and push latest - if: matrix.image.name == 'latest' - uses: docker/build-push-action@v2 - with: - push: true - platforms: linux/amd64,linux/arm64 - tags: tiangolo/uvicorn-gunicorn:latest-debug - context: ./docker-images/ - file: ./docker-images/python${{ matrix.image.python_version }}.dockerfile + file: ./docker-images/${{ env.DOCKERFILE_NAME }}.dockerfile - name: Docker Hub Description uses: peter-evans/dockerhub-description@v3 with: