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