add basic markdown list build process

- rebuild markdown README.md and check for differences against the original
- add build steps to makefile so it can be run locally
- call make from Github actions so it runs automatically on commits/pull requests
This commit is contained in:
nodiscc 2022-04-29 13:30:26 +02:00
parent 170fdb2ac6
commit 9e0b0dec71
4 changed files with 42 additions and 1 deletions

16
.github/workflows/ci.yml vendored Normal file
View file

@ -0,0 +1,16 @@
name: awesome-selfhosted CI
on:
push:
pull_request:
branches: [ master ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v3
- name: build
run: make build

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
awesome-selfhosted/
.venv/

23
Makefile Normal file
View file

@ -0,0 +1,23 @@
SHELL := /bin/bash
.PHONY: install # install in a virtualenv
install:
python3 -m venv .venv
source .venv/bin/activate && \
pip3 install git+https://github.com/nodiscc/hecat.git@master
.PHONY: import # import data from original list at https://github.com/awesome-selfhosted/awesome-selfhosted
import: install
rm -rf awesome-selfhosted && git clone --depth=1 https://github.com/awesome-selfhosted/awesome-selfhosted
cp awesome-selfhosted/.github/.mailmap .mailmap
cp awesome-selfhosted/AUTHORS.md AUTHORS.md
mkdir -p {tags,software,platforms}
source .venv/bin/activate && \
hecat import --source-file awesome-selfhosted/README.md --output-directory ./
.PHONY: build # build markdown singlepage document from yaml data
build: install
rm -rf awesome-selfhosted && git clone https://github.com/awesome-selfhosted/awesome-selfhosted
source .venv/bin/activate && \
hecat build --source-directory ./ --output-directory awesome-selfhosted --output-file README.md
cd awesome-selfhosted && git diff --color=always

View file

@ -62,7 +62,7 @@ In [single page mode](https://github.com/awesome-selfhosted/awesome-selfhosted)
## Build the markdown list
```bash
make run
make build
```
## Maintenance tasks