alpha
Login
or
Join now
flo-bit.dev
/
tiny-docs
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
[READ-ONLY] Mirror of https://github.com/flo-bit/tiny-docs. quick setup, simple, minimalistic docs for your github project
flo-bit.dev/tiny-docs/
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
add reusable workflow
author
Florian
date
9 months ago
(Oct 26, 2025, 9:11 PM +0100)
commit
165c873a
165c873ac5bbfe8720815090113e8b8e43557af2
parent
73540d8b
73540d8ba4a2f6950c899804c4aac79c80319416
+99
1 changed file
Expand all
Collapse all
Unified
Split
.github
workflows
tiny-docs.yml
+99
.github/workflows/tiny-docs.yml
View file
Reviewed
···
1
1
+
name: Tiny Docs (Reusable)
2
2
+
3
3
+
on:
4
4
+
workflow_call:
5
5
+
inputs:
6
6
+
tiny_docs_repo:
7
7
+
description: "Owner/Repo of your tiny-docs source (default: flo-bit/tiny-docs)"
8
8
+
required: false
9
9
+
type: string
10
10
+
site:
11
11
+
description: "Docs site domain (default: <owner>.github.io)"
12
12
+
required: false
13
13
+
type: string
14
14
+
base:
15
15
+
description: "Docs base path (default: /<repo-name>)"
16
16
+
required: false
17
17
+
type: string
18
18
+
name:
19
19
+
description: "Project name (default: <repo-name>)"
20
20
+
required: false
21
21
+
type: string
22
22
+
23
23
+
permissions:
24
24
+
contents: read
25
25
+
pages: write
26
26
+
id-token: write
27
27
+
28
28
+
jobs:
29
29
+
build:
30
30
+
runs-on: ubuntu-latest
31
31
+
steps:
32
32
+
- name: Checkout target repository
33
33
+
uses: actions/checkout@v4
34
34
+
35
35
+
- name: Ensure docs-builder exists (checkout tiny-docs if missing)
36
36
+
if: ${{ hashFiles('docs-builder/**') == '' }}
37
37
+
uses: actions/checkout@v4
38
38
+
with:
39
39
+
repository: ${{ inputs.tiny_docs_repo != '' && inputs.tiny_docs_repo || 'flo-bit/tiny-docs' }}
40
40
+
path: docs-builder
41
41
+
42
42
+
- name: Derive defaults (owner/repo → site/base/name)
43
43
+
id: derive
44
44
+
shell: bash
45
45
+
run: |
46
46
+
OWNER="${GITHUB_REPOSITORY%/*}"
47
47
+
REPO="${GITHUB_REPOSITORY#*/}"
48
48
+
49
49
+
SITE_DEFAULT="${OWNER}.github.io"
50
50
+
BASE_DEFAULT="/${REPO}"
51
51
+
NAME_DEFAULT="${REPO}"
52
52
+
53
53
+
SITE="${{ inputs.site || '' }}"
54
54
+
BASE="${{ inputs.base || '' }}"
55
55
+
NAME="${{ inputs.name || '' }}"
56
56
+
57
57
+
SITE="${SITE:-$SITE_DEFAULT}"
58
58
+
BASE="${BASE:-$BASE_DEFAULT}"
59
59
+
NAME="${NAME:-$NAME_DEFAULT}"
60
60
+
61
61
+
echo "site=$SITE" >> "$GITHUB_OUTPUT"
62
62
+
echo "base=$BASE" >> "$GITHUB_OUTPUT"
63
63
+
echo "name=$NAME" >> "$GITHUB_OUTPUT"
64
64
+
65
65
+
- name: Create docs/config.json if missing
66
66
+
shell: bash
67
67
+
run: |
68
68
+
mkdir -p docs
69
69
+
if [ ! -f docs/config.json ]; then
70
70
+
cat > docs/config.json <<'JSON'
71
71
+
{
72
72
+
"site": "__SITE__",
73
73
+
"base": "__BASE__",
74
74
+
"name": "__NAME__"
75
75
+
}
76
76
+
JSON
77
77
+
sed -i "s|__SITE__|${{ steps.derive.outputs.site }}|g" docs/config.json
78
78
+
sed -i "s|__BASE__|${{ steps.derive.outputs.base }}|g" docs/config.json
79
79
+
sed -i "s|__NAME__|${{ steps.derive.outputs.name }}|g" docs/config.json
80
80
+
echo "Created docs/config.json"
81
81
+
else
82
82
+
echo "docs/config.json already exists; leaving it unchanged."
83
83
+
fi
84
84
+
85
85
+
- name: Install, build, and upload the site artifact
86
86
+
uses: withastro/action@v3
87
87
+
with:
88
88
+
path: docs-builder/
89
89
+
90
90
+
deploy:
91
91
+
needs: build
92
92
+
runs-on: ubuntu-latest
93
93
+
environment:
94
94
+
name: github-pages
95
95
+
url: ${{ steps.deployment.outputs.page_url }}
96
96
+
steps:
97
97
+
- name: Deploy to GitHub Pages
98
98
+
id: deployment
99
99
+
uses: actions/deploy-pages@v4