Skip to content

gh pages deployment #138

gh pages deployment

gh pages deployment #138

Workflow file for this run

name: Deploy MkDocs
on:
push:
branches:
- main
workflow_dispatch: # to enable manual triggers
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: false
- name: Set up SSH access for private submodule (Bash)
shell: bash
run: |
mkdir -p ~/.ssh
# Decode if Base64 encoded, otherwise echo directly. Assuming direct key content for now.
echo "${{ secrets.SUBMODULE_DEPLOY_KEY }}" | tr -d '\r' > ~/.ssh/id_ed25519
chmod 600 ~/.ssh/id_ed25519
ssh-keyscan github.com >> ~/.ssh/known_hosts
echo "SSH key setup complete."
# Add a verification step: Try to load the key fingerprint
echo "Verifying key load..."
ssh-keygen -l -f ~/.ssh/id_ed25519 || (echo "ERROR: Failed to load key fingerprint. Key format in secret is likely invalid." && exit 1)
echo "Key loaded successfully by ssh-keygen."
- name: Configure Git to use SSH for github.com
run: git config --global url."git@github.com:".insteadOf "https://github.com/"
shell: bash
- name: Initialize submodules
run: |
git submodule sync --recursive
git submodule update --init --recursive
shell: bash
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install mkdocs mkdocs-material "mkdocstrings[python]" mkdocs-exclude
- name: Install build dependencies
run: |
pip install build scikit-build cmake ninja "pybind11[global]"
- name: Build and install the package
run: |
python -m pip install .
- name: Deploy to GitHub Pages
env:
GIT_USER: github-actions[bot]
GIT_EMAIL: github-actions[bot]@users.noreply.github.com
run: |
git config user.name "$GIT_USER"
git config user.email "$GIT_EMAIL"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
mkdocs gh-deploy --force --clean