2021-11-29 10:26:11 +00:00
|
|
|
name: Build docs
|
|
|
|
|
|
|
|
on:
|
2022-03-30 11:36:37 +01:00
|
|
|
release:
|
|
|
|
types: [published]
|
2021-11-29 10:26:11 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
deploy:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
steps:
|
2023-04-27 12:24:06 +01:00
|
|
|
- uses: actions/checkout@v3
|
2021-11-29 10:26:11 +00:00
|
|
|
|
2022-06-08 16:30:46 +01:00
|
|
|
- name: Use Node.js
|
2023-04-27 12:24:06 +01:00
|
|
|
uses: actions/setup-node@v3
|
2022-06-08 16:30:46 +01:00
|
|
|
with:
|
2023-04-27 12:24:06 +01:00
|
|
|
node-version-file: .node-version
|
2022-06-08 16:30:46 +01:00
|
|
|
|
|
|
|
# We want to install matrix-appservice-bridge, which we depend on.
|
|
|
|
- run: yarn --ignore-scripts
|
|
|
|
|
2022-03-30 11:36:37 +01:00
|
|
|
- name: Get release tag
|
|
|
|
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
|
|
|
|
2022-11-21 18:38:50 +01:00
|
|
|
- name: Set up mdBook
|
2021-11-29 10:26:11 +00:00
|
|
|
uses: peaceiris/actions-mdbook@v1
|
|
|
|
with:
|
|
|
|
mdbook-version: '0.4.11'
|
|
|
|
|
2022-03-30 11:36:37 +01:00
|
|
|
- name: Set version of docs
|
|
|
|
run: echo 'window.HOOKSHOT_VERSION = "${{ env.RELEASE_VERSION }}";' > ./docs/_site/version.js
|
|
|
|
|
2021-11-29 10:26:11 +00:00
|
|
|
- run: mdbook build
|
|
|
|
|
|
|
|
- name: Deploy latest
|
|
|
|
uses: peaceiris/actions-gh-pages@v3
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
keep_files: true
|
|
|
|
publish_dir: ./book
|
2022-03-30 11:36:37 +01:00
|
|
|
destination_dir: ./${{ env.RELEASE_VERSION }}
|