diff options
author | Andrew Morgan <andrew@amorgan.xyz> | 2021-05-27 18:32:21 +0100 |
---|---|---|
committer | Andrew Morgan <andrew@amorgan.xyz> | 2021-05-27 18:40:59 +0100 |
commit | 7a49d1318192b36d8764b112506eea4320ff7ad2 (patch) | |
tree | a3b99b6be5decf177ba942c3799d72a891ffc8f5 | |
parent | Refine the sidebar: switch to headers without labels (diff) | |
download | synapse-anoa/mdbook_ci_versions.tar.xz |
Additionally deploy to a folder named after current Synapse version github/anoa/mdbook_ci_versions anoa/mdbook_ci_versions
Doing so will allow us to build up releases of the docs as we create and push to release branches. In the future we'll have some UI on the website to switch between versions, but for now you can simple just change 'latest' to 'v1.2.3' in the URL.
-rw-r--r-- | .github/workflows/docs.yaml | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index a0eb95b5d0..20b5d0fed3 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -1,12 +1,10 @@ name: Deploy the documentation -#on: -# release: -# types: [created] on: push: branches: - develop + - release-v* workflow_dispatch: @@ -22,13 +20,37 @@ jobs: with: mdbook-version: '0.4.8' - - name: Build the documentatino - run: mdbook build + - 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 latest documentation directories - name: Deploy latest documentation uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} keep_files: true publish_dir: ./book - destination_dir: ./latest \ No newline at end of file + destination_dir: ./latest + + - name: Get the current Synapse version + id: vars + run: echo ::set-output name=synapse-version::`python3 -c 'import synapse; print(synapse.__version__)'` + + # 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 + destination_dir: ./v${{ steps.vars.outputs.synapse-version }} |