Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Deploy a documentation version for each new Synapse release #10198

Merged
merged 5 commits into from
Jun 18, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ name: Deploy the documentation
on:
push:
branches:
# For bleeding-edge documentation
- develop
# For documentation specific to a release
- 'release-v*'

workflow_dispatch:

Expand All @@ -22,10 +25,34 @@ jobs:
- name: Build the documentation
run: mdbook build

# Deploy to the latest documentation directories
- name: Deploy latest documentation
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
publish_dir: ./book
destination_dir: ./develop

- name: Get the current Synapse version
id: vars
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
# The $GITHUB_REF value for a branch looks like `refs/heads/release-v1.2`. We do some
# bash magic to remove the "refs/heads/release-v" bit from this, to end up with
# "1.2" - our major/minor version number.
run: echo ::set-output name=synapse-version::${GITHUB_REF#refs/heads/release-v}

# Deploy to the version-specific directory
- name: Deploy release-specific documentation
# We only carry out this step if we're running on a release branch,
# and the current Synapse version does not have "rc" in the name.
#
# The result is that only full releases are deployed, but can be
# updated if the release branch gets retroactive fixes.
if: ${{ startsWith( github.ref, 'refs/heads/release-v' ) && !contains( steps.vars.outputs.synapse-version, 'rc') }}
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
publish_dir: ./book
# The resulting documentation will end up in a directory named `vX.Y`.
destination_dir: ./v${{ steps.vars.outputs.synapse-version }}
Empty file added changelog.d/10198.doc
Empty file.