Update ReadMe.md #21
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: Convert README to HTML | |
| on: | |
| push: | |
| paths: | |
| - 'README.md' | |
| - 'ReadMe.md' | |
| - 'readme.md' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| convert-readme: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| - name: Install markdown converter | |
| run: npm install -g marked | |
| - name: Convert README to HTML | |
| run: | | |
| # Find README file | |
| if [ -f "ReadMe.md" ]; then | |
| echo "Converting ReadMe.md to readme.html" | |
| marked -i ReadMe.md -o readme.html --gfm --breaks | |
| elif [ -f "README.md" ]; then | |
| echo "Converting README.md to readme.html" | |
| marked -i README.md -o readme.html --gfm --breaks | |
| else | |
| echo "No README file found" | |
| exit 1 | |
| fi | |
| echo "HTML conversion completed" | |
| ls -la readme.html | |
| - name: Commit changes | |
| run: | | |
| git config --local user.email "action@github.com" | |
| git config --local user.name "GitHub Action" | |
| git add readme.html | |
| git commit -m "Auto-generate readme.html" || echo "No changes to commit" | |
| git push || echo "Nothing to push" |