Publish Tutorials (Books) #142
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: Publish Tutorials (Books) | |
| on: | |
| push: | |
| branches: [ master ] | |
| paths: | |
| - "notes.programming_with_ai/**" | |
| - "notes.startup_admin_guide/**" | |
| - "blog/docs/styles/**" | |
| - "blog/docs/assets/**" | |
| - "helpers_root/dev_scripts_helpers/documentation/mkdocs/**" | |
| - ".github/workflows/publish_tutorials_books.yml" | |
| schedule: | |
| - cron: "0 5 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install MkDocs + plugins | |
| run: | | |
| pip install --upgrade pip | |
| pip install mkdocs mkdocs-material pymdown-extensions mkdocs-blogging-plugin | |
| # Build both books into the desired subpaths under _site/. | |
| - name: Build notes.programming_with_ai | |
| working-directory: notes.programming_with_ai | |
| run: | | |
| python ../helpers_root/dev_scripts_helpers/documentation/mkdocs/preprocess_mkdocs.py \ | |
| --input_dir docs --output_dir tmp.mkdocs -v INFO | |
| mkdocs build -f mkdocs.yml --site-dir ../_site/books/notes.programming_with_ai | |
| - name: Build notes.startup_admin_guide | |
| working-directory: notes.startup_admin_guide | |
| run: | | |
| python ../helpers_root/dev_scripts_helpers/documentation/mkdocs/preprocess_mkdocs.py \ | |
| --input_dir docs --output_dir tmp.mkdocs -v INFO | |
| mkdocs build -f mkdocs.yml --site-dir ../_site/books/notes.startup_admin_guide | |
| - name: Configure Pages | |
| uses: actions/configure-pages@v5 | |
| - name: Upload Pages artifact | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: _site | |
| - name: Deploy GitHub Pages | |
| id: deployment | |
| uses: actions/deploy-pages@v4 |