-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Publish the test site to Netlify (#3575)
* change from surge to netlify * use env variables available from netlify * add bundle size to page * fix size cmd
- Loading branch information
Showing
7 changed files
with
18 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,31 @@ | ||
#!/usr/bin/env bash | ||
|
||
# -------------------------------------------------------------------- | ||
# Publishes a small test site that uses the packages/web3/dist/min | ||
# Prepares a small test site that uses the packages/web3/dist/min | ||
# -------------------------------------------------------------------- | ||
|
||
if [ -z "$CI" ]; then | ||
|
||
echo "======================================================================" | ||
echo "This script publishes a test site with surge.sh. Only run in CI." | ||
echo "This script prepares a test site for Netlify. Only run in CI. " | ||
echo "======================================================================" | ||
|
||
exit 1 | ||
|
||
fi | ||
|
||
echo "======================================================================" | ||
echo "Publishing test site with surge.sh. See link below. " | ||
echo "Preparing test site for web3-staging.netlify.app " | ||
echo "======================================================================" | ||
|
||
# Mark file with current commit and branch | ||
sed -i "s|__COMMIT_HASH__|$GITHUB_SHA|g" scripts/html/index.html | ||
sed -i "s|__BRANCH__|$GITHUB_REF|g" scripts/html/index.html | ||
|
||
cp packages/web3/dist/web3.min.js scripts/html | ||
cd scripts | ||
(echo "" && exit && cat ) | npx surge --domain sudden-playground.surge.sh html | ||
|
||
# Might be running locally in development | ||
rm html/web3.min.js | ||
cd scripts/html | ||
|
||
BUNDLE_SIZE=$(wc -c web3.min.js | awk '{print $1}') | ||
|
||
# Mark file with current commit, branch, and bundle size. | ||
sed -i "s|__COMMIT_HASH__|$COMMIT_REF|g" index.html | ||
sed -i "s|__BRANCH__|$BRANCH|g" index.html | ||
sed -i "s|__BUNDLE_SIZE__|$BUNDLE_SIZE|g" index.html | ||
|
||
# Sometimes surge.sh fails with an auth error because it's generated a name which | ||
# is already taken (or something?) This test is just meant to be a visual | ||
# inspection check if/when there are doubts - we don't want it crash CI alot. | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters