Skip to content

Commit 86992df

Browse files
committed
fix env name
1 parent bcea9c1 commit 86992df

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

.env

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VITE_VERSION_LATEST="v11.0.0"
2-
VITE_VERSION_NEXT="v12.0.0"
2+
VITE_VERSION_NEXT="v12.0.0"
3+
VITE_DEPLOYMENT_URL="https://foo.bar.com"

.github/workflows/deploy.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,25 @@ jobs:
3131
run: yarn install
3232
- name: Sync playground bundles
3333
run: yarn build:sync-bundles
34-
- name: Set PUBLIC_DEPLOYMENT_URL
34+
- name: Set VITE_DEPLOYMENT_URL
3535
shell: bash
3636
run: |
3737
RAW_BRANCH="${{ github.head_ref || github.ref_name }}"
3838
3939
if [[ "$RAW_BRANCH" == "master" ]]; then
40-
echo "PUBLIC_DEPLOYMENT_URL=" >> "$GITHUB_ENV"
40+
echo "VITE_DEPLOYMENT_URL=" >> "$GITHUB_ENV"
4141
else
4242
SAFE_BRANCH="${RAW_BRANCH//\//-}"
4343
4444
SAFE_BRANCH=$(echo "$SAFE_BRANCH" | tr '[:upper:]' '[:lower:]')
4545
4646
echo "SAFE_BRANCH=$SAFE_BRANCH" >> "$GITHUB_ENV"
47-
echo "PUBLIC_DEPLOYMENT_URL=https://${SAFE_BRANCH}.rescript-lang.pages.dev" >> "$GITHUB_ENV"
47+
echo "VITE_DEPLOYMENT_URL=https://${SAFE_BRANCH}.rescript-lang.pages.dev" >> "$GITHUB_ENV"
4848
fi
4949
- name: Build
5050
run: yarn build
5151
env:
52-
PUBLIC_DEPLOYMENT_URL: ${{ env.PUBLIC_DEPLOYMENT_URL }}
52+
VITE_DEPLOYMENT_URL: ${{ env.VITE_DEPLOYMENT_URL }}
5353
- name: Deploy
5454
id: deploy
5555
uses: cloudflare/wrangler-action@v3

src/bindings/Env.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
external dev: bool = "import.meta.env.DEV"
33

44
// Cloudflare deployment URL
5-
external deployment_url: option<string> = "import.meta.env.PUBLIC_DEPLOYMENT_URL"
5+
external deployment_url: option<string> = "import.meta.env.VITE_DEPLOYMENT_URL"
66

77
// the root url of the site, e.g. "https://rescript-lang.org/" or "http://localhost:5173/"
88
let root_url = switch deployment_url {

src/common/Util.res

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ module Url = {
6262

6363
let makeOpenGraphImageUrl = (title, description) => {
6464
let baseUrl = Env.deployment_url->Option.getOr(Env.root_url)
65+
Console.log(baseUrl)
6566
`${baseUrl}${baseUrl->Stdlib.String.endsWith("/")
6667
? ""
6768
: "/"}ogimage.png?title=${title}&description=${description}`

0 commit comments

Comments
 (0)