Skip to content

Commit 658135b

Browse files
committed
initial commit
Signed-off-by: James Knight <git@jdknight.me>
0 parents  commit 658135b

6 files changed

Lines changed: 150 additions & 0 deletions

File tree

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Docker
2+
3+
on:
4+
schedule:
5+
- cron: '25 5 2 * *'
6+
push:
7+
branches: [ "main" ]
8+
tags: '*'
9+
pull_request:
10+
branches: [ "main" ]
11+
workflow_dispatch:
12+
13+
env:
14+
REGISTRY: ghcr.io
15+
IMAGE_NAME: ${{ github.repository }}
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
permissions:
21+
contents: read
22+
packages: write
23+
# This is used to complete the identity challenge
24+
# with sigstore/fulcio when running outside of PRs.
25+
id-token: write
26+
27+
steps:
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
# Install the cosign tool except on PR
32+
# https://github.com/sigstore/cosign-installer
33+
- name: Install cosign
34+
if: github.event_name != 'pull_request'
35+
uses: sigstore/cosign-installer@v3.8.1
36+
with:
37+
cosign-release: 'v2.4.3'
38+
39+
# Set up BuildKit Docker container builder to be able to build
40+
# multi-platform images and export cache
41+
# https://github.com/docker/setup-buildx-action
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
45+
# Login against a Docker registry except on PR
46+
# https://github.com/docker/login-action
47+
- name: Log into registry ${{ env.REGISTRY }}
48+
if: github.event_name != 'pull_request'
49+
uses: docker/login-action@v3
50+
with:
51+
registry: ${{ env.REGISTRY }}
52+
username: ${{ github.actor }}
53+
password: ${{ secrets.GITHUB_TOKEN }}
54+
55+
# Extract metadata (tags, labels) for Docker
56+
# https://github.com/docker/metadata-action
57+
- name: Extract Docker metadata
58+
id: meta
59+
uses: docker/metadata-action@v5
60+
with:
61+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
62+
63+
# Build and push Docker image with Buildx (don't push on PR)
64+
# https://github.com/docker/build-push-action
65+
- name: Build and push Docker image
66+
id: build-and-push
67+
uses: docker/build-push-action@v6
68+
with:
69+
context: .
70+
push: ${{ github.event_name != 'pull_request' }}
71+
tags: ${{ steps.meta.outputs.tags }}
72+
labels: ${{ steps.meta.outputs.labels }}
73+
cache-from: type=gha
74+
cache-to: type=gha,mode=max
75+
76+
# Sign the resulting Docker image digest except on PRs.
77+
# This will only write to the public Rekor transparency log when the Docker
78+
# repository is public to avoid leaking data. If you would like to publish
79+
# transparency data even for private images, pass --force to cosign below.
80+
# https://github.com/sigstore/cosign
81+
- name: Sign the published Docker image
82+
if: ${{ github.event_name != 'pull_request' }}
83+
env:
84+
# https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
85+
TAGS: ${{ steps.meta.outputs.tags }}
86+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
87+
# This step uses the identity token to provision an ephemeral certificate
88+
# against the sigstore community Fulcio instance.
89+
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}

Dockerfile

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-License-Identifier: BSD-2-Clause
2+
# Copyright releng-tool
3+
4+
FROM ubuntu:latest
5+
6+
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
7+
gettext \
8+
git \
9+
make \
10+
pipx \
11+
python-is-python3 \
12+
rsync \
13+
texlive-full \
14+
xindy \
15+
&& rm -rf /var/lib/apt/lists/* \
16+
&& useradd -ms /bin/bash default
17+
18+
USER default
19+
WORKDIR /home/default
20+
ENV PATH="$PATH:/home/default/.local/bin"
21+
22+
RUN pipx install sphinx && \
23+
pipx inject sphinx \
24+
furo \
25+
myst-parser \
26+
pygments \
27+
sphinx \
28+
sphinx-inline-tabs \
29+
sphinx-intl

LICENSE

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright 2025 releng-tool
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
1. Redistributions of source code must retain the above copyright notice, this
7+
list of conditions and the following disclaimer.
8+
9+
2. Redistributions in binary form must reproduce the above copyright notice,
10+
this list of conditions and the following disclaimer in the documentation
11+
and/or other materials provided with the distribution.
12+
13+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
14+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
15+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
16+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
17+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
18+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
19+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
20+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
21+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Documentation support container
2+
3+
This repository provides a container definition used to help processing
4+
documentation with Sphinx.

test-build

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
3+
exec docker build "$@" -t ghcr.io/releng-tool/docs-container .

test-run

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env sh
2+
3+
exec docker run "$@" -it --rm ghcr.io/releng-tool/docs-container

0 commit comments

Comments
 (0)