ci: speed up mdbook build by using pre-built binaries, and remove som… #86
This file contains hidden or 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: Render docs and upload website to webxdc.org | |
| on: | |
| push: | |
| branches: | |
| - '**' | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download and setup mdbook | |
| run: | | |
| MDBOOK_VERSION="0.4.40" | |
| curl -sSL "https://github.com/rust-lang/mdBook/releases/download/v${MDBOOK_VERSION}/mdbook-v${MDBOOK_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -xz | |
| sudo mv mdbook /usr/local/bin/ | |
| # Michael-F-Bryan is the original author, see github link on https://crates.io/crates/mdbook-linkcheck | |
| - name: Install mdbook-linkcheck | |
| run: | | |
| curl -sSL "https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/download/v0.7.7/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip" -o mdbook-linkcheck.zip | |
| unzip mdbook-linkcheck.zip mdbook-linkcheck | |
| chmod +x mdbook-linkcheck | |
| sudo mv mdbook-linkcheck /usr/local/bin/ | |
| - name: Build docs and prepare website/ contents | |
| run: | | |
| cd src-docs | |
| mdbook build | |
| mv book/html ../website/docs | |
| cd .. | |
| mv apps website/ | |
| - name: Upload website/ to webxdc.org | |
| if: github.ref == 'refs/heads/main' && github.event_name == 'push' | |
| run: | | |
| mkdir -p "$HOME/.ssh" | |
| echo "${{ secrets.KEY }}" > "$HOME/.ssh/key" | |
| chmod 600 "$HOME/.ssh/key" | |
| rsync -avzh -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no" "website/" "${{ secrets.USERNAME }}@delta.chat:/var/www/html/webxdc.org" |