Skip to content

Commit 7b49c70

Browse files
committed
Hard override prefixes in preview
1 parent d4a0c92 commit 7b49c70

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

.github/workflows/test-deploy.yaml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,16 @@ jobs:
5555
run: |
5656
npm run build
5757
npm run build:docs
58-
- name: Build preview docs
58+
- name: Create preview build
5959
run: |
6060
cd build/docs/gatsby
61-
npm install
62-
# Backup original config
63-
cp gatsby-config.js gatsby-config-original.js
64-
# Modify config for preview
65-
sed -i 's|pathPrefix: "/execution-apis"|pathPrefix: "/execution-apis/preview/PR${{ github.event.number }}"|g' gatsby-config.js
66-
# Build with modified config
67-
npx gatsby build --prefix-paths
68-
# Restore original config
69-
cp gatsby-config-original.js gatsby-config.js
70-
# Move preview build to separate directory
71-
mv public public-preview
72-
# Rebuild main site
73-
npx gatsby build --prefix-paths
61+
# Copy the built files for preview
62+
cp -r public public-preview
63+
# Fix paths in the preview build
64+
find public-preview -name "*.html" -exec sed -i 's|href="/execution-apis/|href="/execution-apis/preview/PR${{ github.event.number }}/|g' {} \;
65+
find public-preview -name "*.html" -exec sed -i 's|src="/execution-apis/|src="/execution-apis/preview/PR${{ github.event.number }}/|g' {} \;
66+
find public-preview -name "*.js" -exec sed -i 's|"/execution-apis/|"/execution-apis/preview/PR${{ github.event.number }}/|g' {} \;
67+
find public-preview -name "*.css" -exec sed -i 's|url(/execution-apis/|url(/execution-apis/preview/PR${{ github.event.number }}/|g' {} \;
7468
- name: Cache docs build output
7569
uses: actions/cache@v4
7670
with:

docs/reference/contributors-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Contributors Guide
1+
# Contributors Guide with cheese
22

33
This guide will explain for new and experienced contributors alike how to
44
propose changes to Ethereum JSON-RPC API.

0 commit comments

Comments
 (0)