Update ch 8. Scheduling.md #47
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: Sync, Build, and Deploy Book | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| concurrency: | |
| group: pages | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout main | |
| uses: actions/checkout@v4 | |
| with: | |
| path: main | |
| - name: Checkout gh-pages-website | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: gh-pages-website | |
| path: website | |
| - name: Copy markdown files | |
| run: | | |
| rsync -av \ | |
| --include='*/' \ | |
| --include='README.md' \ | |
| --include='ch *.md' \ | |
| --exclude='*' \ | |
| main/ website/src/ | |
| - name: Commit and push source sync | |
| run: | | |
| cd website | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add src | |
| git diff --cached --quiet || git commit -m "Sync book sources from main" | |
| git push origin gh-pages-website | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Install mdBook | |
| run: cargo install mdbook | |
| - name: Build book | |
| working-directory: website | |
| run: mdbook build | |
| - name: Setup Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: website/book | |
| - name: Deploy to GitHub Pages | |
| uses: actions/deploy-pages@v4 |