build(makefile): 增强构建系统功能并改进日志输出 #15
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: Deploy Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@nightly | |
| with: | |
| targets: x86_64-unknown-none | |
| - name: Install mdBook (Latest Binary) | |
| run: | | |
| mkdir bin | |
| curl -sSL https://api.github.com/repos/rust-lang/mdBook/releases/latest \ | |
| | grep "browser_download_url.*x86_64-unknown-linux-gnu.tar.gz" \ | |
| | cut -d : -f 2,3 \ | |
| | tr -d \" \ | |
| | xargs curl -sSL \ | |
| | tar -xz -C bin | |
| echo "$(pwd)/bin" >> $GITHUB_PATH | |
| - name: Build Documentation | |
| run: make doc | |
| - name: Deploy to Cloudflare Pages | |
| uses: cloudflare/wrangler-action@v3 | |
| with: | |
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | |
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | |
| command: pages deploy book --project-name=prokadoc |