diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e57c49d..74b9684 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,14 +6,22 @@ on: - cron: "0 18 * * 1" 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: runs-on: ubuntu-latest + needs: prepare strategy: - matrix: - image: - - name: "beeper_bridge-manager" - context: ./beeper_bridge-manager - dockerfile: ./beeper_bridge-manager/docker/Dockerfile + matrix: ${{ fromJson(needs.prepare.outputs.matrix) }} steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..698bc2d --- /dev/null +++ b/.pre-commit-config.yaml @@ -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$ diff --git a/README.md b/README.md new file mode 100644 index 0000000..d130afd --- /dev/null +++ b/README.md @@ -0,0 +1,9 @@ +# Docker Images + +These are some custom images that are regularly built for AMD64 and ARM64 architectures. + + +| 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. | + diff --git a/generate-readme.py b/generate-readme.py new file mode 100755 index 0000000..9df948a --- /dev/null +++ b/generate-readme.py @@ -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 == "": + 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 == "": + f.write(line + "\n") + copying = True + elif copying: + f.write(line + "\n") diff --git a/images.json b/images.json new file mode 100644 index 0000000..d057628 --- /dev/null +++ b/images.json @@ -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." + } +]