Cleaning lints #52
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: Deploy Documentation | |
on: | |
push: | |
branches: | |
- main | |
workflow_dispatch: | |
jobs: | |
deploy: | |
name: Build and Deploy Documentation | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Install mdbook and plugins | |
run: | | |
# Install mdbook | |
cargo install mdbook | |
# Install mdbook-mermaid plugin | |
cargo install mdbook-mermaid | |
- name: Build and Deploy to Server | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.NEW_SERVER_HOST }} | |
username: ${{ secrets.DOCS_USER }} | |
key: ${{ secrets.DOCS_PRIVATE_KEY }} | |
script: | | |
set -e | |
echo "Cleaning up previous build..." | |
rm -rf /home/${{ secrets.DOCS_USER }}/build | |
mkdir -p /home/${{ secrets.DOCS_USER }}/build/book | |
echo "Cloning repository and building documentation..." | |
cd /home/${{ secrets.DOCS_USER }}/build | |
git clone [email protected]:TrueBlocks/trueblocks-khedra | |
cd trueblocks-khedra/book | |
# Make sure the Mermaid plugin is available | |
mdbook build | |
echo "Deploying to the book server..." | |
rsync -avz book/ /var/www/khedra.trueblocks.io/html/ | |
- name: Verify Build Output | |
run: | | |
if [ ! -d "book" ]; then | |
echo "Build failed: book directory not found!" | |
exit 1 | |
fi | |
echo "Build verification passed!" |