Merge pull request #714 from rabwill/model-blog #378
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: | |
| inputs: | |
| reason: | |
| description: 'Reason for manual deployment (optional)' | |
| required: false | |
| default: 'Manual deployment' | |
| type: string | |
| workflow_call: | |
| # Allows this workflow to be called by other workflows | |
| jobs: | |
| deploy: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: 📥 Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🐍 Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: 📦 Install MkDocs dependencies | |
| run: pip install "mkdocs-material" "mkdocs-static-i18n[material]" | |
| - name: 🚀 Deploy to GitHub Pages | |
| run: mkdocs gh-deploy --force | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: 📊 Deployment summary | |
| run: | | |
| echo "## 🚀 Documentation Deployed" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| # Determine trigger type | |
| if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then | |
| echo "**Trigger:** Manual deployment" >> $GITHUB_STEP_SUMMARY | |
| echo "**Reason:** ${{ github.event.inputs.reason }}" >> $GITHUB_STEP_SUMMARY | |
| elif [ "${{ github.event_name }}" == "workflow_call" ]; then | |
| echo "**Trigger:** Called by another workflow" >> $GITHUB_STEP_SUMMARY | |
| else | |
| echo "**Trigger:** Push to main branch" >> $GITHUB_STEP_SUMMARY | |
| fi | |
| echo "**Site URL:** https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}" >> $GITHUB_STEP_SUMMARY | |
| echo "**Deployment time:** $(date -u)" >> $GITHUB_STEP_SUMMARY |