1- Website
2- =======
1+ # Website
2+
3+ [ ![ CI status] ( https://github.com/reactphp/website/workflows/CI/badge.svg )] ( https://github.com/reactphp/website/actions )
34
45Source code of reactphp.org.
56
6- Setup
7- -----
7+ ## Setup
88
991 . Copy ` .env.dist ` to ` .env ` and add a
1010 [ personal access token] ( https://github.com/settings/tokens ) to the
@@ -17,20 +17,69 @@ Setup
1717
18182 . Install dependencies with ` $ composer install ` .
1919
20- Auto-Deployment with Travis CI
21- ------------------------------
20+ ## Build
21+
22+ Once set up, you can build the website by executing this:
23+
24+ ``` bash
25+ $ bin/build
26+ ```
27+
28+ This script will fetch all project repositories and then rebuild the entire website.
29+ The resulting static website will be built into the ` tmp/build ` directory.
30+
31+ If you're working on the website source code, you may want to skip fetching all
32+ components on every build like this:
33+
34+ ``` bash
35+ $ bin/build --no-component-update
36+ ```
37+
38+ If you're working on the website CSS or Javascript code, you will have to
39+ rebuild the static assets like this:
40+
41+ ``` bash
42+ $ npm run-script build
43+ ```
44+
45+ > Note that compiled assets are expected to change much less frequently and are
46+ under version control. Run ` npm install ` to install and later commit any changes
47+ in ` static-files/assets/ ` .
48+
49+ ## Deploy
50+
51+ Once built (see previous chapter), deployment is as simple as hosting the static
52+ website contents of the ` tmp/build ` directory behind a webserver of your choice.
53+
54+ We use GitHub Pages to deploy this to the live site. This is done by pushing the
55+ contents of the ` tmp/build ` directory to the repository hosted in
56+ [ reactphp/reactphp.github.io] ( https://github.com/reactphp/reactphp.github.io ) .
57+
58+ This deployment can be started by executing this:
59+
60+ ``` bash
61+ $ bin/build --deploy
62+ ```
63+
64+ Note that this will publish any changes you've made to your local repository,
65+ including any uncommitted ones. There should usually be no need to do this
66+ manually, see next chapter for auto-deployment.
67+
68+ ## Auto-Deployment
69+
70+ The website can be automatically deployed via the GitHub Pages feature.
2271
23- The website can be automatically deployed via the Travis CI
24- [ GitHub Pages Deployment ] ( https://docs.travis-ci.com/user/deployment/pages/ )
25- feature .
72+ Any time a commit is merged (such as when a PR is merged), GitHub actions will
73+ automatically build and deploy the website. This is done by running the above
74+ deployment script (see previous chapter) .
2675
27- Make sure, the required environment variables are set in the repository settings
28- on Travis CI: ` GITHUB_TOKEN `
29- ([ a personal access token] ( https://docs.travis-ci.com/user/deployment/pages/#Setting-the-GitHub-token ) ),
30- ` DEPLOY_REPO ` , ` DEPLOY_TARGET_BRANCH ` and ` DEPLOY_FQDN ` .
76+ > Repository setup:
77+ > We're using a SSH deploy key for pushing to this target repository.
78+ > Make sure the required ` DEPLOY_KEY ` secret is set in the repository settings on GitHub.
79+ > See [ action documentation] ( https://github.com/JamesIves/github-pages-deploy-action#using-an-ssh-deploy-key- )
80+ > for more details.
3181
32- License
33- -------
82+ ## License
3483
3584Released under the [ MIT] ( LICENSE ) license.
3685
0 commit comments