Skip to content

Commit 21b92fa

Browse files
gbraadanjannath
authored andcommitted
Update mdbook version and automate container build
1 parent ad455cf commit 21b92fa

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

.devcontainer/Containerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/crc-org/mdbook:0.4.43
1+
FROM ghcr.io/crc-org/mdbook:latest
22

33
RUN dnf install -y git-core \
44
&& dnf clean all \

.github/workflows/container.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Build Container
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
name: Build Container
9+
runs-on: 'ubuntu-latest'
10+
11+
steps:
12+
- name: Check out repository code
13+
uses: actions/checkout@v4
14+
15+
- name: Build container
16+
run: |
17+
podman build -t ghcr.io/${{ github.repository_owner }}/mdbook:latest \
18+
-f containers/Containerfile
19+
20+
- name: Login to container registry
21+
run: |
22+
podman login ghcr.io -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }}
23+
24+
- name: Push to registry
25+
run: |
26+
podman push ghcr.io/${{ github.repository_owner }}/mdbook:latest
27+

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For example, it is easy to use `.` to start the GitHub Web Editor to read and ed
2626
To create the HTML output, you can use:
2727

2828
```
29-
$ podman run --rm -v $PWD:/workspace quay.io/crc-org/mdbook:0.4.43 build
29+
$ podman run --rm -v $PWD:/workspace ghcr.io/crc-org/mdbook:latest build
3030
```
3131

3232
This will create a `book` folder that contains the output for a static webpage like GitHub Pages.
@@ -41,4 +41,4 @@ $ npm install -g @devcontainers/cli
4141
$ devcontainer up --workspace-folder .
4242
```
4343

44-
After the container has been started, you can use `mdbook build` to generate the output, and `mdbook serve` to open a preview using the forward of port 3000.
44+
After the container has been started, you can use `mdbook build` to generate the output, and `mdbook serve` to open a preview using the forward of port 3000.

containers/Containerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
FROM registry.fedoraproject.org/fedora:40 AS builder
1+
FROM registry.access.redhat.com/ubi9:latest AS builder
22

33

44
RUN dnf install -y cargo openssl-devel \
5-
&& cargo install mdbook \
5+
&& cargo install mdbook --locked \
66
&& cargo install mdbook-callouts \
77
&& cargo install mdbook-mermaid \
8-
&& cargo install mdbook-kroki-preprocessor
8+
&& cargo install mdbook-kroki-preprocessor --locked
99

1010

11-
FROM registry.fedoraproject.org/fedora:40
11+
FROM registry.access.redhat.com/ubi9:latest
1212

1313
COPY --from=builder /root/.cargo/bin/mdbook /usr/bin
1414
COPY --from=builder /root/.cargo/bin/mdbook-callouts /usr/bin

0 commit comments

Comments
 (0)