name: docs-ci on: workflow_dispatch: push: branches: - main paths: - docs/** - docs-standalone/** - .github/workflows/docs-release.yml - mkdocs.yml - docs-standalone/mkdocs.yml - HMI/README.md jobs: deploy: runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v6 with: fetch-depth: 0 - uses: actions/setup-python@v6 with: python-version: 3.x - run: pip install zensical - run: cp HMI/README.md docs/hmi-serial-protocol.md - run: zensical build --config-file mkdocs.yml - run: mv site _site_main - run: zensical build --config-file docs-standalone/mkdocs.yml - run: mkdir -p _site/standalone _site/stable - run: cp -a _site_main/. _site/ - run: cp -a _site_main/. _site/stable/ - run: | if [ -d site-standalone ]; then cp -a site-standalone/. _site/standalone/ elif [ -d docs-standalone/site ]; then cp -a docs-standalone/site/. _site/standalone/ elif [ -d site ]; then cp -a site/. _site/standalone/ elif [ -d docs-standalone/build ]; then cp -a docs-standalone/build/. _site/standalone/ elif [ -d build ]; then cp -a build/. _site/standalone/ else echo "Standalone docs output not found (tried site-standalone, docs-standalone/site, site, docs-standalone/build, build)." exit 1 fi - uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_branch: gh-pages publish_dir: _site force_orphan: true