From cdb78214a5fbb23858ce91a1f673118041a555b7 Mon Sep 17 00:00:00 2001 From: Paul Woelfel Date: Sat, 28 Sep 2024 23:33:31 +0200 Subject: [PATCH 1/2] Fix env vars for prod --- .github/workflows/cloud-run.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cloud-run.yml b/.github/workflows/cloud-run.yml index a47e115..3217e50 100644 --- a/.github/workflows/cloud-run.yml +++ b/.github/workflows/cloud-run.yml @@ -76,11 +76,10 @@ jobs: VERSION_TAG=$(echo -n ${VERSION_TAG:0:30} | sed 's@-$@@') echo "VERSION_TAG=${VERSION_TAG}" >>.version - # if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then - # # prod version - # else - # SERVICE="${SERVICE}-dev" - # fi + if [[ "${GITHUB_REF_TYPE}" == "tag" ]]; then + export NEXT_PUBLIC_FIRESTORE_DB="" + SERVICE=$(echo -n "${SERVICE}-dev" | sed 's@/-dev$//') + fi if [[ "${NEXT_PUBLIC_FIRESTORE_DB}" == "default" ]]; then # set to empty string From 80efe32f121dc9b5bd9dbca417ef14f8e6d0cd15 Mon Sep 17 00:00:00 2001 From: Paul Woelfel Date: Sat, 28 Sep 2024 23:35:25 +0200 Subject: [PATCH 2/2] Persist env var --- .github/workflows/cloud-run.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/cloud-run.yml b/.github/workflows/cloud-run.yml index 3217e50..39cdf49 100644 --- a/.github/workflows/cloud-run.yml +++ b/.github/workflows/cloud-run.yml @@ -85,6 +85,11 @@ jobs: # set to empty string export NEXT_PUBLIC_FIRESTORE_DB="" fi + + echo "NEXT_PUBLIC_FIRESTORE_DB='${NEXT_PUBLIC_FIRESTORE_DB}'" >>$GITHUB_ENV + echo "RUN_SERVICE='${RUN_SERVICE}'" >>$GITHUB_ENV + + echo "RUN_REGION='${RUN_REGION}'" >>.version echo "NEXT_PUBLIC_FIRESTORE_DB='${NEXT_PUBLIC_FIRESTORE_DB}'" >>.version echo "RUN_SERVICE='${RUN_SERVICE}'" >>.version echo "RUN_REGION='${RUN_REGION}'" >>.version