mirror of
https://github.com/element-hq/synapse.git
synced 2024-11-30 00:14:57 +03:00
675ff0d5d0
* Bump peaceiris/actions-gh-pages from 3.9.2 to 3.9.3
Bumps [peaceiris/actions-gh-pages](https://github.com/peaceiris/actions-gh-pages) from 3.9.2 to 3.9.3.
- [Release notes](https://github.com/peaceiris/actions-gh-pages/releases)
- [Changelog](https://github.com/peaceiris/actions-gh-pages/blob/main/CHANGELOG.md)
- [Commits](bd8c6b06eb...373f7f263a
)
---
updated-dependencies:
- dependency-name: peaceiris/actions-gh-pages
dependency-type: direct:production
update-type: version-update:semver-patch
...
Signed-off-by: dependabot[bot] <support@github.com>
* Changelog
---------
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: GitHub Actions <github-actions[bot]@users.noreply.github.com>
104 lines
3.1 KiB
YAML
104 lines
3.1 KiB
YAML
name: Deploy the documentation
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
# For bleeding-edge documentation
|
|
- develop
|
|
# For documentation specific to a release
|
|
- 'release-v*'
|
|
# stable docs
|
|
- master
|
|
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
pre:
|
|
name: Calculate variables for GitHub Pages deployment
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# Figure out the target directory.
|
|
#
|
|
# The target directory depends on the name of the branch
|
|
#
|
|
- name: Get the target directory name
|
|
id: vars
|
|
run: |
|
|
# first strip the 'refs/heads/' prefix with some shell foo
|
|
branch="${GITHUB_REF#refs/heads/}"
|
|
|
|
case $branch in
|
|
release-*)
|
|
# strip 'release-' from the name for release branches.
|
|
branch="${branch#release-}"
|
|
;;
|
|
master)
|
|
# deploy to "latest" for the master branch.
|
|
branch="latest"
|
|
;;
|
|
esac
|
|
|
|
# finally, set the 'branch-version' var.
|
|
echo "branch-version=$branch" >> "$GITHUB_OUTPUT"
|
|
outputs:
|
|
branch-version: ${{ steps.vars.outputs.branch-version }}
|
|
|
|
################################################################################
|
|
pages-docs:
|
|
name: GitHub Pages
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- pre
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Setup mdbook
|
|
uses: peaceiris/actions-mdbook@adeb05db28a0c0004681db83893d56c0388ea9ea # v1.2.0
|
|
with:
|
|
mdbook-version: '0.4.17'
|
|
|
|
- name: Build the documentation
|
|
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
|
|
# However, we're using docs/README.md for other purposes and need to pick a new page
|
|
# as the default. Let's opt for the welcome page instead.
|
|
run: |
|
|
mdbook build
|
|
cp book/welcome_and_overview.html book/index.html
|
|
|
|
# Deploy to the target directory.
|
|
- name: Deploy to gh pages
|
|
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./book
|
|
destination_dir: ./${{ needs.pre.outputs.branch-version }}
|
|
|
|
################################################################################
|
|
pages-devdocs:
|
|
name: GitHub Pages (developer docs)
|
|
runs-on: ubuntu-latest
|
|
needs:
|
|
- pre
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: "Set up Sphinx"
|
|
uses: matrix-org/setup-python-poetry@v1
|
|
with:
|
|
python-version: "3.x"
|
|
poetry-version: "1.3.2"
|
|
groups: "dev-docs"
|
|
extras: ""
|
|
|
|
- name: Build the documentation
|
|
run: |
|
|
cd dev-docs
|
|
poetry run make html
|
|
|
|
# Deploy to the target directory.
|
|
- name: Deploy to gh pages
|
|
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3.9.3
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
publish_dir: ./dev-docs/_build/html
|
|
destination_dir: ./dev-docs/${{ needs.pre.outputs.branch-version }}
|