Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
fix(playground): base url not propagated to vite (#2452)
Browse files Browse the repository at this point in the history
* fix: base url not propagated to vite

* Added ability to propagate base url via environment variable, so switched to that
  • Loading branch information
Nicholas Yang authored Apr 14, 2022
1 parent 2ac2009 commit 03c946e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy_playground.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ jobs:
id: sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"

- run: pnpm build --prefix website/playground -- --base=/${{ steps.sha.outputs.sha }}/
- run: BASE_URL="/${{ steps.sha.outputs.sha }}/" pnpm --prefix website/playground build

- name: Publish
uses: jakejarvis/s3-sync-action@master
env:
Expand All @@ -50,7 +51,7 @@ jobs:
if: github.event_name == 'pull_request'
id: url
run: |
url="[Playground for commit](https://play.rome.tools/${{ steps.sha.outputs.sha }}/)"
url="[Playground for commit ${{ steps.sha.outputs.sha }}](https://play.rome.tools/${{ steps.sha.outputs.sha }}/)"
echo "::set-output name=url::$url"
- name: Get the PR number
Expand Down
2 changes: 1 addition & 1 deletion website/playground/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";

// https://vitejs.dev/config/
export default defineConfig({ plugins: [react()] });
export default defineConfig({ base: process.env.BASE_URL, plugins: [react()] });

0 comments on commit 03c946e

Please sign in to comment.