Skip to content

Commit 4675762

Browse files
committed
Docs: add docs pipeline
1 parent 5132722 commit 4675762

1 file changed

Lines changed: 56 additions & 0 deletions

File tree

.github/workflows/docs.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: "Documentation"
2+
3+
on: # yamllint disable-line rule:truthy
4+
workflow_call:
5+
6+
env:
7+
REGISTRY: "ghcr.io"
8+
9+
jobs:
10+
documentation:
11+
name: "Documentation"
12+
runs-on: "ubuntu-latest"
13+
14+
steps:
15+
- name: "Checkout"
16+
uses: "actions/checkout@v4"
17+
18+
- name: "Render Documentation"
19+
uses: "docker://phpdoc/phpdoc:latest"
20+
with:
21+
args: "run --config-file=phpdoc.dist.xml"
22+
23+
- name: "Prepare docker image"
24+
run: |
25+
echo ":80" > build/docs/Caddyfile
26+
echo "file_server {" >> build/docs/Caddyfile
27+
echo " root /data" >> build/docs/Caddyfile
28+
echo "}" >> build/docs/Caddyfile
29+
30+
echo "FROM caddy:2-alpine" > build/docs/Dockerfile
31+
echo "COPY Caddyfile /etc/caddy/Caddyfile" >> build/docs/Dockerfile
32+
echo "COPY . /data" > build/docs/Dockerfile
33+
34+
- name: "Prepare image name"
35+
run: |
36+
echo IMAGE_NAME=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
37+
38+
- name: "Set up QEMU"
39+
uses: "docker/setup-qemu-action@v3"
40+
41+
- name: "Set up Docker Buildx"
42+
uses: "docker/setup-buildx-action@v3"
43+
44+
- name: "Login to Docker Hub"
45+
uses: "docker/login-action@v3"
46+
with:
47+
registry: ${{ env.REGISTRY }}
48+
username: ${{ github.actor }}
49+
password: ${{ secrets.GITHUB_TOKEN }}
50+
51+
- name: "Build and push"
52+
uses: "docker/build-push-action@v5"
53+
with:
54+
context: "build/docs"
55+
push: true
56+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest

0 commit comments

Comments
 (0)