add readme

This commit is contained in:
Aravinth Manivannan 2021-10-29 20:37:30 +05:30
parent 067e0085c2
commit 4d5f6ebd6f
Signed by: realaravinth
GPG Key ID: AD9F0F08E855ED88
1 changed files with 48 additions and 0 deletions

48
README.md Normal file
View File

@ -0,0 +1,48 @@
<div align="center">
<img width="120px" src="./static/cache/img/logo.svg" alt="pages logo">
<h1> Pages </h1>
<p>
**Auto-deploy static websites from git repositories**
</p>
[![Build](https://github.com/realaravinth/pages/actions/workflows/linux.yml/badge.svg)](https://github.com/realaravinth/pages/actions/workflows/linux.yml)
[![dependency status](https://deps.rs/repo/github/realaravinth/pages/status.svg)](https://deps.rs/repo/github/realaravinth/pages)
[![codecov](https://codecov.io/gh/realaravinth/pages/branch/master/graph/badge.svg)](https://codecov.io/gh/realaravinth/pages)
</div>
## Why?
SSHing into a server and performing a `git pull` is boring. I couldn't
find any free(as in freedom) software for automating static website
deploys like GitHub Pages or Netlify.
This is very minimal, all it does is a `git fetch $branch` but it works
for me :)
## Usage
1. All configuration is done through
[./config/default.toml](./config/default.toml)(can be moved to
`/etc/static-pages/config.toml`). Too add a website,
make a similar entry:
```toml
pages = [
{ branch = "gh-pages", repo = "https://github.com/realaravinth/realaravinth/", path ="/var/www/pages/realaravinth", secret = "mytopsecretsuperlongpassword123" },
]
```
2. If `pages` is deployed at `pages.example.com` and you wish to deploy
changes from `gh-pages` branch, you can do so with the following
command:
```bash
curl -v --location --request POST 'https://pages.example.com/api/v1/update' \
--header 'Content-Type: application/json' \
--data-raw "{
\"secret\": \"$token\",
\"branch\": \"gh-pages\"
}"
```