Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ aliases:
- website/node_modules
key: v2-dependencies-{{ .Branch }}-{{ checksum "yarn.lock" }}

- &deploy
- &website
command: |
if [[ $CIRCLE_PROJECT_USERNAME == "facebook" && -z $CI_PULL_REQUEST && -z $CIRCLE_PR_USERNAME ]]; then
# Deploy Jest website using Docusaurus bot
# 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
Expand All @@ -32,7 +32,8 @@ aliases:
# build and publish website
GIT_USER=docusaurus-bot USE_SSH=false yarn publish-gh-pages
else
echo "Skipping deploy."
echo "Skipping deploy. Test website build"
cd website && yarn && yarn build
fi

- &filter-ignore-gh-pages
Expand Down Expand Up @@ -129,7 +130,7 @@ jobs:
- store_test_results:
path: reports/junit

test-and-deploy-website:
test-or-deploy-website:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should call it just deploy-website

Copy link
Contributor Author

@endiliey endiliey Jul 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can change the name but is the naming okay ?

this PR implementation is

  • if it is a push to branch (not a PR) -> deploy jestjs.io website
  • if it is a PR -> test the static website build without deploying

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, we should leave this naming

working_directory: ~/jest
docker:
- image: circleci/node:8
Expand All @@ -139,7 +140,7 @@ jobs:
- restore-cache: *restore-cache
- run: yarn --no-progress
- save-cache: *save-cache
- deploy: *deploy
- run: *website

# Workflows enables us to run multiple jobs in parallel
workflows:
Expand All @@ -152,5 +153,5 @@ workflows:
- test-node-10
- test-jest-circus
- test-browser
- test-and-deploy-website:
- test-or-deploy-website:
filters: *filter-ignore-gh-pages
11 changes: 7 additions & 4 deletions website/pages/en/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ const translation = require('../../server/translation.js');
const backers = require(process.cwd() + '/backers.json');

const siteConfig = require(process.cwd() + '/siteConfig.js');
const idx = (target, path) =>
path.reduce((obj, key) => (obj && obj[key] ? obj[key] : null), target);

class Button extends React.Component {
render() {
Expand Down Expand Up @@ -130,10 +132,11 @@ class HomeSplash extends React.Component {
<h2 className="projectTitle">
{siteConfig.title}
<small>
{
translation[this.props.language]['localized-strings']
.tagline
}
{idx(translation, [
this.props.language,
'localized-strings',
'tagline',
]) || siteConfig.tagline}
</small>
</h2>
<div className="section promoSection">
Expand Down