doc: automatic builds and deployment using Forgejo Actions
Actions run in a custom Docker image built by the scripts in `doc/docker`. There are two jobs that run in sequence: - `build-doc`: builds the documentation from the AsciiDoc sources. - `deploy-doc`: Uploads the generated files to http://0fm.de
This commit is contained in:
parent
10f634d144
commit
f686635837
24
.forgejo/workflows/doc.yaml
Normal file
24
.forgejo/workflows/doc.yaml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
on: [push]
|
||||||
|
jobs:
|
||||||
|
build-doc:
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: git.tkolb.de/amateurfunk/hamnet70/asciidoctor:1.6
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- run: cd doc && make
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: documentation
|
||||||
|
path: doc/out/
|
||||||
|
deploy-doc:
|
||||||
|
needs: build-doc
|
||||||
|
runs-on: docker
|
||||||
|
container:
|
||||||
|
image: git.tkolb.de/amateurfunk/hamnet70/asciidoctor:1.6
|
||||||
|
steps:
|
||||||
|
- run: mkdir ~/.ssh && echo "${{ secrets.SSH_KEY }}" > ~/.ssh/id_ed25519 && chmod 0600 ~/.ssh/id_ed25519 && echo "${{ secrets.SSH_KNOWN_HOST }}" > ~/.ssh/known_hosts
|
||||||
|
- uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: documentation
|
||||||
|
- run: 'rsync -e "ssh -p 2342" -r . deployment@tkolb.de:'
|
16
doc/docker/Dockerfile
Normal file
16
doc/docker/Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
FROM debian:stable
|
||||||
|
|
||||||
|
# for basic Forgejo + AsciiDoctor support
|
||||||
|
RUN apt update && apt install -y --no-install-recommends nodejs git ruby-rubygems make && apt clean
|
||||||
|
|
||||||
|
RUN gem install asciidoctor asciidoctor-diagram
|
||||||
|
|
||||||
|
# tools for diagram generation
|
||||||
|
RUN apt install -y --no-install-recommends mscgen && apt clean
|
||||||
|
|
||||||
|
# tools for automatic deployment
|
||||||
|
RUN apt install -y --no-install-recommends rsync openssh-client && apt clean
|
||||||
|
|
||||||
|
# run as unprivileged user in the container
|
||||||
|
RUN useradd -m ciuser
|
||||||
|
USER ciuser
|
8
doc/docker/build.sh
Executable file
8
doc/docker/build.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "usage: $0 <tag-version>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker build -t git.tkolb.de/amateurfunk/hamnet70/asciidoctor:$1 .
|
8
doc/docker/test.sh
Executable file
8
doc/docker/test.sh
Executable file
|
@ -0,0 +1,8 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "usage: $0 <tag-version>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker run -v $(realpath ..):/doc -it git.tkolb.de/amateurfunk/hamnet70/asciidoctor:$1
|
10
doc/docker/upload.sh
Executable file
10
doc/docker/upload.sh
Executable file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "usage: $0 <tag-version>"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker login
|
||||||
|
docker push git.tkolb.de/amateurfunk/hamnet70/asciidoctor:$1
|
||||||
|
docker logout
|
Loading…
Reference in a new issue