diff options
| -rw-r--r-- | .github/workflows/build-deploy.yaml | 22 | ||||
| -rw-r--r-- | thallium-backend/Dockerfile | 3 |
2 files changed, 17 insertions, 8 deletions
diff --git a/.github/workflows/build-deploy.yaml b/.github/workflows/build-deploy.yaml index cc4c7b5..2387024 100644 --- a/.github/workflows/build-deploy.yaml +++ b/.github/workflows/build-deploy.yaml @@ -6,14 +6,14 @@ on: required: true type: string project: - description: "The project to build and push" - required: true - type: string + description: "The project to build and push" + required: true + type: string dockerfile: - description: "The Dockerfile to use for the build" - required: false - type: string - default: "Dockerfile" + description: "The Dockerfile to use for the build" + required: false + type: string + default: "Dockerfile" jobs: build: @@ -34,6 +34,11 @@ jobs: username: ${{ github.repository_owner }} password: ${{ github.token }} + - name: Fetch project version (Backend) + if: ${{ inputs.project == 'backend' }} + run: >- + echo "THALLIUM_SEMVER=$(poetry version -s)" >> $GITHUB_ENV + # Build and push the container to the GitHub Container # Repository. The container will be tagged as "latest" # and with the short SHA of the commit. @@ -50,6 +55,7 @@ jobs: ghcr.io/owl-corp/thallium-${{ inputs.project }}:${{ inputs.sha-tag }} build-args: | git_sha=${{ github.sha }} + thallium_semver=${{ env.THALLIUM_SEMVER || '' }} deploy: name: Deploy @@ -77,4 +83,4 @@ jobs: namespace: merch manifests: | infra/kubernetes/namespaces/merch/deployment.yaml - images: 'ghcr.io/owl-corp/thallium-${{ inputs.project }}:${{ inputs.sha-tag }}' + images: "ghcr.io/owl-corp/thallium-${{ inputs.project }}:${{ inputs.sha-tag }}" diff --git a/thallium-backend/Dockerfile b/thallium-backend/Dockerfile index c448b0a..8ec3bec 100644 --- a/thallium-backend/Dockerfile +++ b/thallium-backend/Dockerfile @@ -17,5 +17,8 @@ HEALTHCHECK --start-period=5s --interval=30s --timeout=1s CMD curl http://localh ARG git_sha="development" ENV GIT_SHA=$git_sha +ARG thallium_semver="0.0.0" +ENV THALLIUM_VERSION="$thallium_semver" + ENTRYPOINT ["/bin/bash", "-c"] CMD ["alembic upgrade head && uvicorn src.app:fastapi_app --host 0.0.0.0 --port 8000 --no-server-header"] |