Skip to content

Commit

Permalink
Refactor build scripts for website (#480)
Browse files Browse the repository at this point in the history
* move build scripts to own Makefile within the website directory
* rename targets from docs to website
* remove old and unused couscous configuration file
  • Loading branch information
markuspoerschke authored Dec 23, 2022
1 parent 229f02a commit c21891f
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 55 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
node-version: 18

- name: Build Website
run: "make docs"
run: "make website"

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ The sources are available within the `website/docs/` folder.
To preview the result, you can run:

```
make docs-preview
cd website
make start
```
19 changes: 6 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ INFECTION_FLAGS ?=
help:
@echo 'Available targets'
@echo ' clean Removes temporary build artifacts like'
@echo ' docs Builds the documentation website'
@echo ' website Builds the documentation website'
@echo ' fix Fixes composer.json and code style'
@echo ' fix-prettier Fix code style of non PHP files (not included in "fix" target)'
@echo ' test Execute all tests'
Expand Down Expand Up @@ -90,18 +90,11 @@ fix-prettier: node_modules
node_modules: yarn.lock package.json
yarn

.PHONY: docs
docs: docs-vendor
cd website && yarn build

.PHONY: docs-vendor
docs-vendor:
cd website && yarn

.PHONY: docs-preview
docs-preview: docs-vendor
cd website && yarn start
.PHONY: website
docs: website
cd website && $(MAKE) build

.PHONY: clean
clean:
rm -rf vendor website/node_modules website/build website/.docusaurus node_modules .phpunit.result.cache .php-cs-fixer.cache build
rm -rf vendor node_modules .phpunit.result.cache .php-cs-fixer.cache build
cd website && $(MAKE) clean
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ If you just start using this package, you should install version 2.
| Version | PHP Version |
| ------- | ----------- |
| 2.\* | 7.4 - 8.2 |
| 0.16.\* | 7.0 - 8.0 |
| 0.16.\* | 7.0 - 8.2 |
| 0.11.\* | 5.3.0 - 7.4 |

## Documentation
Expand Down
38 changes: 0 additions & 38 deletions couscous.yml

This file was deleted.

13 changes: 13 additions & 0 deletions website/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
build: node_modules docs/** src/** static/** docusaurus.config.js sidebars.js
yarn build

node_modules: yarn.lock package.json
yarn

.PHONY: start
docs-preview: node_modules
yarn start

.PHONY: clean
clean:
rm -rf node_modules build .docusaurus
2 changes: 1 addition & 1 deletion website/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ module.exports = {
],
},
],
copyright: `Copyright (c) 2012-2021 Markus Poerschke, Published under MIT License`,
copyright: `Copyright (c) 2012-2022 Markus Poerschke, Published under MIT License`,
},
prism: {
additionalLanguages: ["php"],
Expand Down

0 comments on commit c21891f

Please sign in to comment.