Skip to content

Commit

Permalink
chore: test docs publish
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Johner <[email protected]>
  • Loading branch information
moritzjohner-form3 committed Dec 13, 2024
1 parent 17905ec commit 01e3315
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 35 deletions.
23 changes: 16 additions & 7 deletions .github/actions/mkdocs/action.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -e
set -xe

REQUIREMENTS="${GITHUB_WORKSPACE}/docs/requirements.txt"

Expand All @@ -31,20 +31,29 @@ fi
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"

mkdocs build --config-file "${GITHUB_WORKSPACE}/docs/mkdocs.yml"
docs_site_tmp_dir=$(mktemp -d)
cd docs && mkdocs build --config-file "${GITHUB_WORKSPACE}/docs/mkdocs.yml" -d "${docs_site_tmp_dir}"

git clone --branch=gh-pages --depth=1 "${remote_repo}" gh-pages
cd gh-pages
gh_pages_tmp_dir=$(mktemp -d)

cd $gh_pages_tmp_dir
git clone --branch=gh-pages --depth=1 "${remote_repo}" .

# copy current index file index.yaml before any change
temp_worktree=$(mktemp -d)
cp --force "index.yaml" "$temp_worktree/index.yaml"
if [ -f "index.yaml" ]; then
cp --force "index.yaml" "$temp_worktree/index.yaml"
fi
# remove current content in branch gh-pages
git rm -r .
# copy new doc.
cp -r ../site/* .
cp -r "${docs_site_tmp_dir}"/* .

# restore chart index
cp "$temp_worktree/index.yaml" .
if [ -f "index.yaml" ]; then
cp "$temp_worktree/index.yaml" .
fi

# commit changes
git add .
git commit -m "Deploy GitHub Pages"
Expand Down
16 changes: 0 additions & 16 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
.PHONY: check_dead_links
check_dead_links: ## Check if the documentation contains dead links.
@docker run -t \
-w /tmp \
-v $$PWD:/tmp dkhamsing/awesome_bot:1.20.0 \
--allow-dupe \
--allow-redirect $(shell find $$PWD -mindepth 1 -name vendor -prune -o -name .modcache -prune -o -iname Changelog.md -prune -o -name "*.md" | sed -e "s#$$PWD/##")

.PHONY: build-image
build-image:
@docker build \
Expand All @@ -29,11 +21,3 @@ live-docs: build-image ## Build and launch a local copy of the documentation web
--entrypoint /bin/bash \
xpdb-docs \
-c "pip install -r /docs/requirements.txt && mkdocs serve --dev-addr=0.0.0.0:8000"

.PHONY: misspell
misspell: ## Check for spelling errors.
@go install github.com/client9/misspell/cmd/misspell@latest
misspell \
-locale US \
-error \
.
9 changes: 0 additions & 9 deletions docs/extra.css

This file was deleted.

4 changes: 1 addition & 3 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ repo_name: "form3tech-oss/x-pdb"
repo_url: https://github.com/form3tech-oss/x-pdb
site_url: https://form3tech-oss.github.io/x-pdb
edit_uri: edit/main/docs/src
docs_dir: "/docs/src"
docs_dir: "src"

# Extensions
markdown_extensions:
Expand Down Expand Up @@ -63,8 +63,6 @@ plugins:
- minify:
minify_html: true

extra_css: [extra.css]

nav:
- Introduction:
- Overview: "index.md"
Expand Down

0 comments on commit 01e3315

Please sign in to comment.