Add images.json with auto readme and pre-commit
This commit is contained in:
parent
baf11c50a7
commit
feebee5c42
5 changed files with 73 additions and 5 deletions
18
.github/workflows/build.yml
vendored
18
.github/workflows/build.yml
vendored
|
@ -6,14 +6,22 @@ on:
|
||||||
- cron: "0 18 * * 1"
|
- cron: "0 18 * * 1"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
prepare:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
- id: set-matrix
|
||||||
|
run: "echo \"matrix=$(jq -cr '{image: [.[] | {name, context, dockerfile}]}' images.json)\" >> $GITHUB_OUTPUT"
|
||||||
build_image:
|
build_image:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
needs: prepare
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
||||||
image:
|
|
||||||
- name: "beeper_bridge-manager"
|
|
||||||
context: ./beeper_bridge-manager
|
|
||||||
dockerfile: ./beeper_bridge-manager/docker/Dockerfile
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
15
.pre-commit-config.yaml
Normal file
15
.pre-commit-config.yaml
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
repos:
|
||||||
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
rev: v2.3.0
|
||||||
|
hooks:
|
||||||
|
- id: check-yaml
|
||||||
|
- id: end-of-file-fixer
|
||||||
|
- id: trailing-whitespace
|
||||||
|
- repo: local
|
||||||
|
hooks:
|
||||||
|
- id: generate-readme
|
||||||
|
name: Generate README
|
||||||
|
entry: python generate-readme.py
|
||||||
|
language: python
|
||||||
|
pass_filenames: false
|
||||||
|
files: ^images\.json$
|
9
README.md
Normal file
9
README.md
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# Docker Images
|
||||||
|
|
||||||
|
These are some custom images that are regularly built for AMD64 and ARM64 architectures.
|
||||||
|
|
||||||
|
<!-- generate start -->
|
||||||
|
| Name | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| `ghcr.io/jake-walker/beeper_bridge-manager` | This is an exact build of Beeper's [bridge-manager](https://github.com/beeper/bridge-manager) but with an ARM64 build. |
|
||||||
|
<!-- generate end -->
|
28
generate-readme.py
Executable file
28
generate-readme.py
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
import json
|
||||||
|
|
||||||
|
with open("README.md", "r") as f:
|
||||||
|
readme = f.read()
|
||||||
|
|
||||||
|
with open("images.json", "r") as f:
|
||||||
|
images_data = json.load(f)
|
||||||
|
|
||||||
|
with open("README.md", "w") as f:
|
||||||
|
copying = True
|
||||||
|
|
||||||
|
for line in readme.splitlines():
|
||||||
|
if line == "<!-- generate start -->":
|
||||||
|
f.write(line + "\n")
|
||||||
|
|
||||||
|
# generate markdown table of images
|
||||||
|
f.write("| Name | Description |\n| --- | --- |\n")
|
||||||
|
for image in images_data:
|
||||||
|
f.write(
|
||||||
|
f"| `ghcr.io/jake-walker/{image['name']}` | {image['description']} |\n"
|
||||||
|
)
|
||||||
|
|
||||||
|
copying = False
|
||||||
|
elif line == "<!-- generate end -->":
|
||||||
|
f.write(line + "\n")
|
||||||
|
copying = True
|
||||||
|
elif copying:
|
||||||
|
f.write(line + "\n")
|
8
images.json
Normal file
8
images.json
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "beeper_bridge-manager",
|
||||||
|
"context": "./beeper_bridge-manager",
|
||||||
|
"dockerfile": "./beeper_bridge-manager/docker/Dockerfile",
|
||||||
|
"description": "This is an exact build of Beeper's [bridge-manager](https://github.com/beeper/bridge-manager) but with an ARM64 build."
|
||||||
|
}
|
||||||
|
]
|
Loading…
Reference in a new issue