mirror of
https://github.com/sablierapp/sablier.git
synced 2025-12-25 14:59:16 +01:00
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
44 lines
1.3 KiB
YAML
44 lines
1.3 KiB
YAML
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 |