2023-10-17 01:57:03 +03:00
|
|
|
name: Deploy documentation
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2024-07-02 12:27:39 +03:00
|
|
|
branches: [develop]
|
2023-10-17 01:57:03 +03:00
|
|
|
workflow_dispatch: {}
|
|
|
|
|
2024-11-20 18:44:02 +03:00
|
|
|
permissions: {}
|
2023-10-17 10:58:27 +03:00
|
|
|
|
|
|
|
concurrency:
|
2023-10-17 11:16:32 +03:00
|
|
|
group: "pages"
|
|
|
|
cancel-in-progress: false
|
2023-10-17 10:58:27 +03:00
|
|
|
|
2023-10-17 01:57:03 +03:00
|
|
|
jobs:
|
2023-10-17 10:58:27 +03:00
|
|
|
build:
|
2023-10-17 01:57:03 +03:00
|
|
|
name: GitHub Pages
|
2024-10-17 13:10:32 +03:00
|
|
|
runs-on: ubuntu-24.04
|
2023-10-17 01:57:03 +03:00
|
|
|
steps:
|
|
|
|
- name: Fetch element-desktop
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
2023-12-12 13:31:44 +03:00
|
|
|
repository: element-hq/element-desktop
|
2023-10-17 01:57:03 +03:00
|
|
|
path: element-desktop
|
|
|
|
|
|
|
|
- name: Fetch element-web
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
path: element-web
|
|
|
|
|
2023-10-17 12:01:56 +03:00
|
|
|
- name: Fetch matrix-js-sdk
|
|
|
|
uses: actions/checkout@v4
|
|
|
|
with:
|
|
|
|
repository: matrix-org/matrix-js-sdk
|
|
|
|
path: matrix-js-sdk
|
|
|
|
|
2023-10-31 21:42:07 +03:00
|
|
|
- uses: actions/setup-node@v4
|
2023-10-27 16:25:38 +03:00
|
|
|
with:
|
|
|
|
cache: "yarn"
|
2023-10-27 17:00:15 +03:00
|
|
|
cache-dependency-path: element-web/yarn.lock
|
2024-07-09 17:51:43 +03:00
|
|
|
node-version: "lts/*"
|
2023-10-27 16:25:38 +03:00
|
|
|
|
|
|
|
- name: Generate automations docs
|
|
|
|
working-directory: element-web
|
|
|
|
run: |
|
|
|
|
yarn install --frozen-lockfile
|
2024-10-15 16:57:26 +03:00
|
|
|
yarn ts-node ./scripts/gen-workflow-mermaid.ts ../element-desktop ../element-web ../matrix-js-sdk > docs/automations.md
|
2023-10-27 16:25:38 +03:00
|
|
|
echo "- [Automations](automations.md)" >> docs/SUMMARY.md
|
|
|
|
|
2023-10-17 01:57:03 +03:00
|
|
|
- name: Setup mdBook
|
2024-04-16 15:46:50 +03:00
|
|
|
uses: peaceiris/actions-mdbook@v2
|
2023-10-17 01:57:03 +03:00
|
|
|
with:
|
|
|
|
mdbook-version: "0.4.10"
|
|
|
|
|
2023-10-26 10:40:33 +03:00
|
|
|
- name: Install mdbook extensions
|
2024-07-02 12:14:44 +03:00
|
|
|
run: cargo install mdbook-combiner mdbook-mermaid
|
2023-10-17 01:57:03 +03:00
|
|
|
|
2023-10-17 10:48:19 +03:00
|
|
|
- name: Prepare docs
|
2023-10-17 01:57:03 +03:00
|
|
|
run: |
|
2023-10-17 11:16:32 +03:00
|
|
|
mkdir docs
|
2023-10-17 10:48:19 +03:00
|
|
|
|
2023-10-17 11:16:32 +03:00
|
|
|
mv element-desktop/README.md element-desktop/docs/
|
|
|
|
mv element-desktop/docs "docs/Element Desktop"
|
2023-10-17 10:48:19 +03:00
|
|
|
|
2023-10-17 11:16:32 +03:00
|
|
|
mv element-web/README.md element-web/docs/
|
2023-10-27 17:51:59 +03:00
|
|
|
mv element-web/docs/lib docs/
|
2023-10-17 11:16:32 +03:00
|
|
|
mv element-web/docs "docs/Element Web"
|
2023-10-17 10:48:19 +03:00
|
|
|
|
2023-10-17 12:01:56 +03:00
|
|
|
mv matrix-js-sdk/README.md matrix-js-sdk/docs/
|
|
|
|
mv matrix-js-sdk/docs "docs/Matrix JS SDK"
|
|
|
|
|
2023-10-17 11:16:32 +03:00
|
|
|
sed -i -e 's/\.\.\/README.md/README.md/' docs/**/SUMMARY.md
|
2023-10-17 10:48:19 +03:00
|
|
|
|
2023-10-17 01:57:03 +03:00
|
|
|
mdbook-combiner -m docs
|
2023-10-17 12:25:27 +03:00
|
|
|
sed -i -E 's/^\t# (.+)$/- [\1]()/gm;t' SUMMARY.md
|
|
|
|
sed -i -E 's/^- \[(.+)]\(<>\)$/---\n# \1/gm;t' SUMMARY.md
|
|
|
|
sed -i -E 's/\t- \[Introduction]/- [Introduction]/gm;t' SUMMARY.md
|
|
|
|
|
|
|
|
cat <<EOF > docs/SUMMARY.md
|
|
|
|
# Summary
|
|
|
|
- [Introduction](<Element Web/README.md>)
|
|
|
|
|
|
|
|
EOF
|
|
|
|
cat SUMMARY.md >> docs/SUMMARY.md
|
2023-10-17 10:48:19 +03:00
|
|
|
|
|
|
|
mv element-web/book.toml .
|
|
|
|
|
|
|
|
- name: Build docs
|
|
|
|
run: mdbook build
|
2023-10-17 01:57:03 +03:00
|
|
|
|
2023-10-17 10:58:27 +03:00
|
|
|
- name: Upload artifact
|
2024-01-10 13:20:33 +03:00
|
|
|
uses: actions/upload-pages-artifact@v3
|
2023-10-17 01:57:03 +03:00
|
|
|
with:
|
2023-10-17 10:58:27 +03:00
|
|
|
path: ./book
|
|
|
|
|
2024-07-02 12:27:39 +03:00
|
|
|
deploy:
|
|
|
|
environment:
|
|
|
|
name: github-pages
|
|
|
|
url: ${{ steps.deployment.outputs.page_url }}
|
2024-10-17 13:10:32 +03:00
|
|
|
runs-on: ubuntu-24.04
|
2024-11-20 18:44:02 +03:00
|
|
|
permissions:
|
|
|
|
pages: write
|
2024-11-21 18:39:00 +03:00
|
|
|
id-token: write
|
2024-07-02 12:27:39 +03:00
|
|
|
needs: build
|
|
|
|
steps:
|
|
|
|
- name: Deploy to GitHub Pages
|
|
|
|
id: deployment
|
|
|
|
uses: actions/deploy-pages@v4
|