From d17dc7d6e0733b834e26bc4f8a906209443b5976 Mon Sep 17 00:00:00 2001 From: Marcelo Prates Date: Fri, 16 May 2025 22:10:09 -0300 Subject: [PATCH] Enhance GitHub Actions workflow for site deployment and initiate documentation structure for Prettymaps. --- .github/workflows/docs.yml | 17 +++++++++-------- docs/api.md | 5 +++++ docs/index.md | 3 +++ docs/usage.md | 5 +++++ 4 files changed, 22 insertions(+), 8 deletions(-) create mode 100644 docs/api.md create mode 100644 docs/index.md create mode 100644 docs/usage.md diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0f1d95e..a337c3b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -34,17 +34,18 @@ jobs: run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" - # Create orphan branch or switch to it git checkout --orphan site-artifact - # Remove all files (tracked and untracked) - git rm -rf . || true - rm -rf * - # Copy site output to root - cp -r site/* . - # Add a .nojekyll file to prevent GitHub Pages from ignoring files/folders starting with _ + # Remove everything except .git + find . -mindepth 1 ! -regex '^./.git\(/.*\)?' -delete + # Check if site/ exists and is not empty + if [ ! -d site ] || [ -z "$(ls -A site)" ]; then + echo "site/ directory does not exist or is empty. MkDocs build may have failed." + exit 1 + fi + # Copy site output to root (including hidden files) + cp -a site/. . touch .nojekyll git add . - # Only commit if there are files to commit if git diff --cached --quiet; then echo 'No changes to commit' else diff --git a/docs/api.md b/docs/api.md new file mode 100644 index 0000000..35c271c --- /dev/null +++ b/docs/api.md @@ -0,0 +1,5 @@ +# API Reference + +This page will contain the API reference for Prettymaps. + +_More details coming soon!_ \ No newline at end of file diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..a40e10b --- /dev/null +++ b/docs/index.md @@ -0,0 +1,3 @@ +# Prettymaps Documentation + +Welcome to the Prettymaps documentation site. \ No newline at end of file diff --git a/docs/usage.md b/docs/usage.md new file mode 100644 index 0000000..01e3b00 --- /dev/null +++ b/docs/usage.md @@ -0,0 +1,5 @@ +# Usage + +This page will describe how to use Prettymaps. + +_More details coming soon!_ \ No newline at end of file