mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-27 23:46:36 +01:00
docs: add multiversioned documentation (#344)
Documentation is now published on the `gh-pages` branch. The branch will have a folder `docs` containing the following structure: - `./docs` the copy from the `main` docs, but only used for the `index.html` page to do the multi-version routing. - `./docs/main` the copy from the `main` branch docs folder - `./docs/beta` the copy from the `beta` branch docs folder Closes #332
This commit is contained in:
44
.github/workflows/pages.yml
vendored
Normal file
44
.github/workflows/pages.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
name: Github Pages
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- beta
|
||||
paths:
|
||||
- '.github/workflows/pages.yml'
|
||||
- 'docs/**'
|
||||
|
||||
env:
|
||||
# Publish the main documentation in 'docs/main' folder, and the beta in 'docs/beta'
|
||||
# Routing and version selection is handled in the main documentation.
|
||||
DESTINATION_DIR: ${{ github.ref == 'refs/heads/main' && 'docs/main' || 'docs/beta' }}
|
||||
|
||||
jobs:
|
||||
release:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Deploy index.html
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
if: github.ref == 'refs/heads/main'
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs
|
||||
destination_dir: docs
|
||||
# Subfolders docs/main and docs/beta will contain the actual versioned documentation.
|
||||
# This is just to have the rooting properly done at the root.
|
||||
keep_files: true
|
||||
|
||||
- name: Deploy versioned documentation
|
||||
uses: peaceiris/actions-gh-pages@v4
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
publish_dir: ./docs
|
||||
destination_dir: ${{ env.DESTINATION_DIR }}
|
||||
keep_files: false
|
||||
Reference in New Issue
Block a user