bypass circular dependency on same version when publishing (#269) #6
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Book | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
env: | |
RUST_BACKTRACE: full | |
jobs: | |
build: | |
name: Build and deploy book | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cargo install mdbook --no-default-features --features search --vers "^0.4" --locked --quiet | |
- name: Build examples | |
run: | | |
cd ${{ github.workspace }}/examples/basic_charts && cargo run | |
cd ${{ github.workspace }}/examples/statistical_charts && cargo run | |
cd ${{ github.workspace }}/examples/scientific_charts && cargo run | |
cd ${{ github.workspace }}/examples/financial_charts && cargo run | |
cd ${{ github.workspace }}/examples/3d_charts && cargo run | |
cd ${{ github.workspace }}/examples/subplots && cargo run | |
cd ${{ github.workspace }}/examples/shapes && cargo run | |
- run: mdbook build docs/book | |
- name: Checkout gh-pages branch | |
run: | | |
git fetch origin gh-pages:gh-pages | |
git checkout gh-pages | |
- name: Overwrite book content | |
run: | | |
rm -rf content | |
cp -r gh-pages/content . | |
- name: Deploy to GitHub Pages | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
git add content | |
if [ "${{ github.ref_type }}" == "tag" ]; then | |
git commit --allow-empty -m "update book for release ${{ github.ref }}" | |
else | |
git commit --allow-empty -m 'update book from commit ${{ github.sha }}' | |
fi | |
git push origin gh-pages |