Skip to content

Commit

Permalink
Add deploy target and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Aug 6, 2021
1 parent 1b40d42 commit 2c1589c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 9 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@ build:
serve: build
php -S localhost:8080 -t build/

deploy:
git -C build/ init
git -C build/ checkout live 2>/dev/null || git -C build/ checkout -b live
git -C build/ add --all
git -C build/ diff-index HEAD >/dev/null 2>/dev/null || git -C build/ commit -m "Website build"
git -C build/ remote get-url origin >/dev/null 2>/dev/null || git -C build/ remote add origin $(shell git remote get-url origin)
git -C build/ push origin live -f

clean:
rm -rf source/ build/

.PHONY: build serve clean
.PHONY: build serve deploy clean
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,10 @@ $ make clean

Once built (see previous "Build" section), you can simply deploy the `build/`
directory behind a web server of choice.

The live website is deployed by pushing the contents of the `build/` directory to
the `live` branch like this:

```bash
$ make deploy
```

0 comments on commit 2c1589c

Please sign in to comment.