diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index 85ca1e8e2..0234e33a8 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -27,6 +27,9 @@ jobs: REPO_NAME: ${{ github.repository }} # Have to be build variable NEXT_PUBLIC_BASE_URL: ${{ inputs.base-url }} + # required because error pages use build time env vars, not runtime env vars + # it's the same on every environment + EMAIL_VARAAMO_EXT_LINK: "https://lomake.hel.fi/varaamo-palaute" permissions: contents: read @@ -57,6 +60,8 @@ jobs: - name: "Extract ui metadata (tags, labels) for Docker" id: meta uses: docker/metadata-action@v5 + env: + DOCKER_METADATA_PR_HEAD_SHA: true with: images: ${{ steps.repo.outputs.repo }} tags: | @@ -65,16 +70,18 @@ jobs: type=ref,event=branch,priority=1 labels: | org.opencontainers.image.title=Tilavarauspalvelu ${{ env.BUILD_APP }} - org.opencontainers.image.description=Tilavarauspalvelu ${{ env.BUILD_APP }} ${{ github.ref_name }} (${{ github.sha }}). + org.opencontainers.image.description=Tilavarauspalvelu ${{ env.BUILD_APP }} ${{ github.ref_name }}. org.opencontainers.image.version=${{ github.ref_name }} - org.opencontainers.image.revision=${{ github.sha }} - name: "Build container" uses: docker/build-push-action@v6 with: context: . push: true - build-args: APP=${{ env.BUILD_APP }} + build-args: | + APP=${{ env.BUILD_APP }} + NEXT_PUBLIC_BASE_URL=${{ env.NEXT_PUBLIC_BASE_URL }} + EMAIL_VARAAMO_EXT_LINK=${{ env.EMAIL_VARAAMO_EXT_LINK }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} annotations: ${{ steps.meta.outputs.annotations }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 26cce084c..e25e8b377 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,11 +12,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true -env: - # required because error pages use build time env vars, not runtime env vars - # it's the same on every environment - EMAIL_VARAAMO_EXT_LINK: "https://lomake.hel.fi/varaamo-palaute" - jobs: # Build both ui and admin-ui dockers build-ui-docker: diff --git a/Dockerfile b/Dockerfile index 334a49a6c..cab3fffef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,6 +25,10 @@ ARG APP # Required because the client (js bundle) variables are compile time only ARG NEXT_PUBLIC_TILAVARAUS_API_URL ENV NEXT_PUBLIC_TILAVARAUS_API_URL=$NEXT_PUBLIC_TILAVARAUS_API_URL +ARG NEXT_PUBLIC_BASE_URL +ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL +ARG EMAIL_VARAAMO_EXT_LINK +ENV EMAIL_VARAAMO_EXT_LINK=$EMAIL_VARAAMO_EXT_LINK # Build should not fail on missing env variables # TODO this should be removed because we need NEXT_PUBLIC_TILAVARAUS_API_URL to be set during build # unless we let it be undefined and use "" as default value (does it work?) diff --git a/package.json b/package.json index e8c4085b3..9199993e9 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,5 @@ "npkill": "^0.12.2", "turbo": "^1.11.3" }, - "packageManager": "pnpm@9.1.4" + "packageManager": "pnpm@9.11.0" }