Skip to content

Commit e70ecff

Browse files
committed
Add a build container
Signed-off-by: Davide Cavalca <davide@cavalca.name>
1 parent 40fd012 commit e70ecff

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

.github/workflows/container.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Container
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
build-and-push:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
packages: write
16+
steps:
17+
- name: Log into the container registry
18+
uses: docker/login-action@v3
19+
if: github.event_name != 'pull_request'
20+
with:
21+
registry: ghcr.io
22+
username: ${{ github.actor }}
23+
password: ${{ secrets.GITHUB_TOKEN }}
24+
- name: Setup Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
- name: Build the container image
27+
uses: docker/build-push-action@v6
28+
with:
29+
platforms: linux/amd64,linux/arm64
30+
tags: AsahiLinux/mkdocs-asahi:latest
31+
push: ${{ github.event_name != 'pull_request' }}
32+
cache-from: type=gha
33+
cache-to: type=gha,mode=max
34+
# https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry#adding-a-description-to-multi-arch-images
35+
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Build the Asahi Linux documentation website using mkdocs

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM registry.fedoraproject.org/fedora:41
2+
3+
LABEL org.opencontainers.image.description="Build the Asahi Linux documentation website using mkdocs"
4+
LABEL org.opencontainers.image.licenses=MIT
5+
LABEL org.opencontainers.image.source=https://github.com/AsahiLinux/docs
6+
LABEL org.opencontainers.image.vendor="Asahi Linux"
7+
8+
RUN dnf -y install mkdocs-material mkdocs-material+imaging python3-mkdocs-redirects && dnf -y clean all
9+
10+
RUN mkdir /docs
11+
12+
WORKDIR /docs
13+
14+
EXPOSE 8000
15+
ENTRYPOINT ["mkdocs"]
16+
CMD ["serve", "--dev-addr=0.0.0.0:8000"]

0 commit comments

Comments
 (0)