summaryrefslogtreecommitdiff
path: root/README.md
blob: 646764759a82453bae675a71241a56d239c691a9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# homepage

> source for the coolest homepage with the coolest domain name, **webb.page**.



## Prerequisites

- [Bun](https://bun.sh)



## Installation

```sh
bun i
```

```sh
bunx husky init
```

`.husky/pre-commit` is created now. Open that file and input: `bun run pre-commit`.

Every time a commit is made to this repo now, the pre-commit script will run. It builds the site so it's a nice sanity check to ensure you don't upload a broken site to your server.



## Development

```sh
bun run watch
````



## Production

- ensure Bun is installed on your server
- make note of `which bun` to find the path of your install
- `nano /etc/systemd/system/homepage.service`
  ```service
  [Unit]
  After=network.target
  Description=My cool homepage
  Documentation=https://webb.page

  [Service]
  # your Bun path
  ExecStart=/root/.bun/bin/bun start
  Restart=on-failure
  Type=simple
  User=root
  # the path of your homepage
  WorkingDirectory=/var/www/html

  [Install]
  WantedBy=multi-user.target
  ```
- `systemctl start homepage`
- `systemctl enable homepage`
- when making changes to your `homepage.service` file, you'll need to run `systemctl daemon-reload`