Welcome to StackSimplify #1
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 Docsify Documentation | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'docs/**' | |
| - '**/README.md' | |
| - 'generate_sidebar.py' | |
| workflow_dispatch: # Allow manual trigger | |
| permissions: | |
| contents: write | |
| pages: write | |
| id-token: write | |
| # Allow one concurrent deployment | |
| concurrency: | |
| group: "pages" | |
| cancel-in-progress: true | |
| jobs: | |
| generate-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: π Checkout Repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # Fetch all history for proper git operations | |
| - name: π Setup Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' | |
| - name: π Generate Sidebar | |
| run: | | |
| echo "π Generating sidebar from repository structure..." | |
| python generate_sidebar.py | |
| echo "β Sidebar generated successfully!" | |
| - name: π Show Changes | |
| run: | | |
| echo "π Changes to _sidebar.md:" | |
| git diff docs/_sidebar.md || echo "No changes to sidebar" | |
| - name: πΎ Commit Updated Sidebar | |
| run: | | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git config --local user.name "github-actions[bot]" | |
| if git diff --quiet docs/_sidebar.md; then | |
| echo "β No changes to commit" | |
| else | |
| git add docs/_sidebar.md | |
| git commit -m "π Auto-update sidebar [skip ci]" | |
| git push | |
| echo "β Sidebar updated and pushed" | |
| fi | |
| - name: π Deploy to GitHub Pages | |
| uses: peaceiris/actions-gh-pages@v3 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs | |
| publish_branch: gh-pages | |
| user_name: 'github-actions[bot]' | |
| user_email: 'github-actions[bot]@users.noreply.github.com' | |
| commit_message: 'π Deploy documentation - ${{ github.event.head_commit.message }}' | |
| - name: π’ Deployment Summary | |
| run: | | |
| echo "## π Documentation Deployed Successfully!" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "Your documentation site is now live at:" >> $GITHUB_STEP_SUMMARY | |
| echo "π https://stacksimplify.github.io/devops-real-world-project-implementation-on-aws/" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "### Changes" >> $GITHUB_STEP_SUMMARY | |
| echo "- Sidebar automatically regenerated from repository structure" >> $GITHUB_STEP_SUMMARY | |
| echo "- All README files are now accessible through the documentation site" >> $GITHUB_STEP_SUMMARY | |
| echo "" >> $GITHUB_STEP_SUMMARY | |
| echo "β±οΈ Deployment completed at: $(date)" >> $GITHUB_STEP_SUMMARY |