Merge pull request #54 from Tuntii/tech-debt #10
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 Cookbook | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - '.github/workflows/deploy-cookbook.yml' | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install mdBook | |
| uses: peaceiris/actions-mdbook@v2 | |
| with: | |
| mdbook-version: 'latest' | |
| - name: Build Cookbook | |
| run: mdbook build docs/cookbook | |
| - name: Prepare Deployment | |
| run: | | |
| mkdir deploy_root | |
| # Copy landing page to root | |
| cp -r docs/landing/* deploy_root/ | |
| # Copy cookbook to subdirectory | |
| mkdir deploy_root/cookbook | |
| cp -r docs/cookbook/book/* deploy_root/cookbook/ | |
| - name: Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./deploy_root | |
| destination_dir: ./ | |
| keep_files: false # We want to overwrite the root to ensure clean state | |
| commit_message: "Deploy site + cookbook: ${{ github.event.head_commit.message }}" |