-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only test/deploy website if relevant files are changed #6626
Changes from 5 commits
a5ec8eb
56dfdd2
234b52b
f14584b
a4de210
36d421b
6eb2de1
f677baf
031b646
4cb2bc3
59f955b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
WEBSITE_CHANGED=$(git diff-tree --no-commit-id --name-only -r HEAD | grep -E -c "(^docs\/.*)|(^website\/.*)") | ||
if [[ $WEBSITE_CHANGED == 0 ]]; then | ||
echo "Skipping deploy & test. No relevant website files has changed" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry for the nit but this should be:
|
||
exit 0; | ||
else | ||
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then | ||
# configure Docusaurus bot | ||
git config --global user.email "docusaurus-bot@users.noreply.github.com" | ||
git config --global user.name "Website Deployment Script" | ||
echo "machine github.com login docusaurus-bot password $DOCUSAURUS_PUBLISH_TOKEN" > ~/.netrc | ||
# install Docusaurus and generate file of English strings | ||
yarn && cd website && yarn write-translations | ||
# crowdin install | ||
sudo apt-get update | ||
sudo apt-get install default-jre rsync | ||
wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb | ||
sudo dpkg -i crowdin.deb | ||
sleep 5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this sleep still needed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tbh i don't think it is needed but I'm just following the previous script. Want to remove ? Docusaurus use it though i didn't use it on my test site. Still works flawlessly 😂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Kill it |
||
# translations upload/download | ||
yarn crowdin-upload | ||
yarn crowdin-download | ||
# build and publish website | ||
GIT_USER=docusaurus-bot USE_SSH=false yarn publish-gh-pages | ||
else | ||
echo "Skipping deploy. Test website build" | ||
cd website && yarn && yarn build | ||
fi | ||
fi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing newline? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have
set -e
or something?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true. I forget 😢