-
-
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a5ec8eb
Only test/build website if docs/website are changed
endiliey 56dfdd2
Refactor into website.sh
endiliey 234b52b
nits
endiliey f14584b
chmod executable :)
endiliey a4de210
add more echo strings
endiliey 36d421b
review
endiliey 6eb2de1
refactor
endiliey f677baf
fix & nits
endiliey 031b646
rm -rf sleep 5
endiliey 4cb2bc3
update changelog
thymikee 59f955b
Merge branch 'master' into web
thymikee File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,31 +10,6 @@ aliases: | |
- node_modules | ||
- website/node_modules | ||
key: v2-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }} | ||
|
||
- &website | ||
command: | | ||
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then | ||
# configure Docusaurus bot | ||
git config --global user.email "[email protected]" | ||
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 | ||
# 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 | ||
|
||
- &filter-ignore-gh-pages | ||
branches: | ||
|
@@ -140,7 +115,9 @@ jobs: | |
- restore-cache: *restore-cache | ||
- run: yarn --no-progress | ||
- save-cache: *save-cache | ||
- run: *website | ||
- run: | ||
name: Test or Deploy Jest Website | ||
command: ./.circleci/website.sh | ||
|
||
# Workflows enables us to run multiple jobs in parallel | ||
workflows: | ||
|
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
git diff-tree --no-commit-id --name-only -r HEAD > files_changed.txt | ||
if ! grep -E "(^docs\/.*)|(^website\/.*)" files_changed.txt; then | ||
echo "Skipping deploy & test. No relevant website files have changed" | ||
else | ||
echo "Relevant website files have changed" | ||
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then | ||
# configure Docusaurus bot | ||
git config --global user.email "[email protected]" | ||
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 | ||
# 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 |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 😢