Skip to content

Commit

Permalink
github: Create docker container with documentation on every push to n…
Browse files Browse the repository at this point in the history
…ew docs repo
  • Loading branch information
slusarz authored and cmouse committed Jul 1, 2024
1 parent 161d263 commit 674d1e8
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/actions/container/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM ghcr.io/rtsp/docker-lighttpd:latest

COPY .vitepress/dist/ /var/www/html/2.4/
56 changes: 56 additions & 0 deletions .github/workflows/container.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Container

on:
push:
branches:
- new-ce-documentation

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
releasenew:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: npm
- name: Install Dependencies
run: npm ci
- name: Build with VitePress
run: |
npm run docs:build
# Login against a Docker registry
# https://github.com/docker/login-action
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Extract metadata (tags, labels) for Docker
# https://github.com/docker/metadata-action
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
# Build and push Docker image with Buildx
# https://github.com/docker/build-push-action
- name: Build and push Docker image
id: build-and-push
uses: docker/build-push-action@v5
with:
context: .
file: .github/actions/container/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ From [VitePress](https://vitepress.dev/guide/getting-started#prerequisites):
> [!WARNING]
> Ubuntu 22.04 LTS (and prior) does NOT contain a new enough version of nodejs.
>
> Either run in a container (see https://hub.docker.com/\_/node) or install
> Either run in a container (see https://hub.docker.com/_/node) or install
> via out-of-band packages (see https://github.com/nodesource/distributions).
## Installation
Expand Down Expand Up @@ -96,6 +96,27 @@ However, some errors only occur when viewing a page, and will oftentimes
result in a blank or incomplete page render. In these cases, looking at the
browser developer console will generally show the error that has occurred.

## Docker Container

An updated Docker container is produced after every code addition, and can be
used to view the documentation locally.

Container installation information can be found at:
https://github.com/dovecot/documentation/pkgs/container/documentation

The container exposes a web server on port 80, and the documentation is available
in the `2.4` directory.

### Example

Provide access to Dovecot documentation at `http://localhost:8080/`:

```console
docker run --rm \
-p 8080:80 \
ghcr.io/dovecot/documentation:latest
```

## Dovecot-specific VitePress Features

### Directory Structure
Expand Down

0 comments on commit 674d1e8

Please sign in to comment.