Update README.md #32
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: Generate Website from README | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'README.md' | |
| - '.github/workflows/generate-website.yml' | |
| - '.github/generate-website.js' | |
| - '.github/docs.html' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pages: write | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| - name: Install dependencies | |
| run: npm install marked fs-extra marked-alert | |
| - name: Generate website from README | |
| run: | | |
| node .github/generate-website.js | |
| echo 'wts.knugi.dev' > ./docs/CNAME | |
| - name: Deploy to gh-pages | |
| if: github.ref == 'refs/heads/main' # Ensure deployment only happens from main | |
| uses: peaceiris/actions-gh-pages@84c30a85c19949d7eee79c4ff27748b70285e453 # v4.1.0 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: ./docs | |
| publish_branch: gh-pages |