Skip to content

New fetch paths

New fetch paths #39

Workflow file for this run

name: Deploy MkDocs to GitHub Pages
on:
push:
branches:
- main
- master
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout docs
uses: actions/checkout@v4
- name: Checkout specs
uses: actions/checkout@v4
with:
repository: microrack/specs-test
path: specification
- name: Checkout modules
uses: actions/checkout@v4
with:
repository: microrack/modules-test
path: modules
- name: Copy specs content
run: |
mkdir -p docs/specification
# Copy specification files from docs/specs/ in specs-test repo
cp specification/docs/specs/1-mechanical.md docs/specification/mechanical.md
cp specification/docs/specs/2-electrical.md docs/specification/electrical.md
# Copy or create index.md
if [ -f specification/docs/index.md ]; then
cp specification/docs/index.md docs/specification/index.md
else
echo "# Specifications" > docs/specification/index.md
echo "" >> docs/specification/index.md
echo "Technical specifications for the MICRORACK system." >> docs/specification/index.md
fi
echo "=== Copied specification files ==="
ls -la docs/specification/
- name: Copy modules content
run: |
mkdir -p docs/modules
# Copy modules index page
cp modules/docs/index.md docs/modules/index.md
# Copy each module directory with all its contents
for dir in modules/docs/mod-*/; do
module=$(basename "$dir")
cp -r "$dir" "docs/modules/"
echo "Copied ${module}/"
done
echo "=== Copied module files ==="
ls -la docs/modules/
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies
run: pip install mkdocs-material mkdocs-minify-plugin pyyaml
- name: Build site
run: mkdocs build
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./site
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4