Skip to content

update docs, build your own image #17

update docs, build your own image

update docs, build your own image #17

name: mdbook documentation.
on:
pull_request:
paths:
- 'docs/**'
branches:
- 'main'
push:
branches:
- 'main'
paths:
- 'docs/**'
tags:
- "*"
workflow_dispatch:
jobs:
build-docs:
name: mdbook database schema
runs-on: ubuntu-latest
steps:
- name: Check out the source
uses: actions/checkout@v6
- name: Set env
run: cp .env.example .env
- name: Pull Docker images
run: docker compose pull db api
- name: Run PostgSail Database
# Environment variables
env:
# The hostname used to communicate with the PostgreSQL service container
PGHOST: localhost
PGPORT: 5432
PGDATABASE: signalk
PGUSER: username
PGPASSWORD: password
PGSAIL_DB_URI: postgres://username:password@localhost:5432/signalk
run: |
set -eu
source .env
docker compose stop || true
docker compose rm || true
docker compose up -d db && sleep 15
docker compose up migrate
docker compose ps -a
- name: Generate documentation
# Environment variables
env:
PGSAIL_DB_URI: postgres://username:password@localhost:5432/signalk
run: |
cd docs
go install github.com/KarnerTh/mermerd@v0.13.0
~/go/bin/mermerd --runConfig ../mermerdConfig.yaml
mv postgsail.md src/
source <(curl -sL https://raw.githubusercontent.com/k1LoW/tbls/main/use)
tbls doc --rm-dist -c ../tblsConfig.yml --sort
- name: Install mdbook & plugins
uses: taiki-e/install-action@v2
with: { tool: 'mdbook,mdbook-toc,mdbook-tabs,mdbook-mermaid,mdbook-katex,mdbook-alerts,mdbook-linkcheck' }
- name: Install mdbook plugins
run: mdbook-mermaid install docs
#mdbook-excalidraw install docs
- name: Build documentation
run: mdbook build docs
- name: Show the logs
if: always()
run: |
docker compose logs