Max Updates: adding some new fields (Last commit, Last public commit, Top languages, Total Stars), design and add favicon, Rename python scripts, Remove data injector and load data in runtime by ajax from json, Auto minifier for output html file, etc #110 #2
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: Render HTML on Changes | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - '**.py' | |
| - 'layouts/**' | |
| - 'docs/styles.css' | |
| - 'docs/script.js' | |
| pull_request: | |
| types: [closed] | |
| workflow_dispatch: | |
| jobs: | |
| render-html: | |
| if: github.event_name != 'pull_request' || github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout main branch | |
| uses: actions/checkout@v6 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Run render.py | |
| run: python render.py | |
| - name: Check for changes | |
| id: changes | |
| run: | | |
| if git diff --quiet docs/index.html; then | |
| echo "has_changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "has_changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.changes.outputs.has_changes == 'true' | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add docs/index.html | |
| if [ "${{ github.event_name }}" == "pull_request" ]; then | |
| git commit -m "chore: render HTML from merged PR" | |
| else | |
| git commit -m "chore: render HTML after code changes" | |
| fi | |
| git push origin main |