Skip to content

Welcome to StackSimplify #1

Welcome to StackSimplify

Welcome to StackSimplify #1

Workflow file for this run

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