From 4abc8cbecf0c3f0cff297729055b60594b66d044 Mon Sep 17 00:00:00 2001 From: nuno-aac Date: Thu, 30 Nov 2023 12:26:04 +0000 Subject: [PATCH] Fix cms env variables --- .github/workflows/netlify-cms.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/netlify-cms.yml b/.github/workflows/netlify-cms.yml index 4505af846e..aea40f886a 100644 --- a/.github/workflows/netlify-cms.yml +++ b/.github/workflows/netlify-cms.yml @@ -43,14 +43,23 @@ jobs: uses: rlespinasse/github-slug-action@v4 with: slug-maxlength: 28 + + - name: Set URLS + run: | + if [ "${{ env.GITHUB_REF_SLUG_URL }}" = "production" ]; then + echo "VITE_LIVE_PREVIEW_URL=https://www.starknet.io" >> $GITHUB_ENV + echo "VITE_API_BASE_URL=https://www.starknet.io/api" >> $GITHUB_ENV + echo "VITE_DATA_URL=https://www.starknet.io/data" >> $GITHUB_ENV + else + echo "VITE_LIVE_PREVIEW_URL=https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev" >> $GITHUB_ENV + echo "VITE_API_BASE_URL=https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev/api" >> $GITHUB_ENV + echo "VITE_DATA_URL=https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev/data" >> $GITHUB_ENV + fi - name: Build Netlify CMS run: yarn workspace @starknet-io/netlify-cms build env: - VITE_LIVE_PREVIEW_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev VITE_GIT_BRANCH_NAME: ${{ github.ref_name }} - VITE_API_BASE_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev/api - VITE_DATA_URL: https://${{ env.GITHUB_REF_SLUG_URL }}.starknet-websites.pages.dev/data VITE_BACKEND_AUTH_URL: https://netlify-cms-auth.haim-6b2.workers.dev - name: Deploy Netlify CMS