[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/
0

Configure Feed

Select the types of activity you want to include in your feed.

add reusable workflow

+99
+99
.github/workflows/tiny-docs.yml
··· 1 + name: Tiny Docs (Reusable) 2 + 3 + on: 4 + workflow_call: 5 + inputs: 6 + tiny_docs_repo: 7 + description: "Owner/Repo of your tiny-docs source (default: flo-bit/tiny-docs)" 8 + required: false 9 + type: string 10 + site: 11 + description: "Docs site domain (default: <owner>.github.io)" 12 + required: false 13 + type: string 14 + base: 15 + description: "Docs base path (default: /<repo-name>)" 16 + required: false 17 + type: string 18 + name: 19 + description: "Project name (default: <repo-name>)" 20 + required: false 21 + type: string 22 + 23 + permissions: 24 + contents: read 25 + pages: write 26 + id-token: write 27 + 28 + jobs: 29 + build: 30 + runs-on: ubuntu-latest 31 + steps: 32 + - name: Checkout target repository 33 + uses: actions/checkout@v4 34 + 35 + - name: Ensure docs-builder exists (checkout tiny-docs if missing) 36 + if: ${{ hashFiles('docs-builder/**') == '' }} 37 + uses: actions/checkout@v4 38 + with: 39 + repository: ${{ inputs.tiny_docs_repo != '' && inputs.tiny_docs_repo || 'flo-bit/tiny-docs' }} 40 + path: docs-builder 41 + 42 + - name: Derive defaults (owner/repo → site/base/name) 43 + id: derive 44 + shell: bash 45 + run: | 46 + OWNER="${GITHUB_REPOSITORY%/*}" 47 + REPO="${GITHUB_REPOSITORY#*/}" 48 + 49 + SITE_DEFAULT="${OWNER}.github.io" 50 + BASE_DEFAULT="/${REPO}" 51 + NAME_DEFAULT="${REPO}" 52 + 53 + SITE="${{ inputs.site || '' }}" 54 + BASE="${{ inputs.base || '' }}" 55 + NAME="${{ inputs.name || '' }}" 56 + 57 + SITE="${SITE:-$SITE_DEFAULT}" 58 + BASE="${BASE:-$BASE_DEFAULT}" 59 + NAME="${NAME:-$NAME_DEFAULT}" 60 + 61 + echo "site=$SITE" >> "$GITHUB_OUTPUT" 62 + echo "base=$BASE" >> "$GITHUB_OUTPUT" 63 + echo "name=$NAME" >> "$GITHUB_OUTPUT" 64 + 65 + - name: Create docs/config.json if missing 66 + shell: bash 67 + run: | 68 + mkdir -p docs 69 + if [ ! -f docs/config.json ]; then 70 + cat > docs/config.json <<'JSON' 71 + { 72 + "site": "__SITE__", 73 + "base": "__BASE__", 74 + "name": "__NAME__" 75 + } 76 + JSON 77 + sed -i "s|__SITE__|${{ steps.derive.outputs.site }}|g" docs/config.json 78 + sed -i "s|__BASE__|${{ steps.derive.outputs.base }}|g" docs/config.json 79 + sed -i "s|__NAME__|${{ steps.derive.outputs.name }}|g" docs/config.json 80 + echo "Created docs/config.json" 81 + else 82 + echo "docs/config.json already exists; leaving it unchanged." 83 + fi 84 + 85 + - name: Install, build, and upload the site artifact 86 + uses: withastro/action@v3 87 + with: 88 + path: docs-builder/ 89 + 90 + deploy: 91 + needs: build 92 + runs-on: ubuntu-latest 93 + environment: 94 + name: github-pages 95 + url: ${{ steps.deployment.outputs.page_url }} 96 + steps: 97 + - name: Deploy to GitHub Pages 98 + id: deployment 99 + uses: actions/deploy-pages@v4