Build README #1760
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: Build README | |
| on: | |
| push: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out repo | |
| uses: actions/checkout@v2 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - uses: actions/cache@v3 | |
| name: Configure npm caching | |
| with: | |
| path: ~/.npm | |
| key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
| restore-keys: | | |
| ${{ runner.os }}-node- | |
| - name: Install Node.js dependencies | |
| run: | | |
| npm install | |
| - name: Update README | |
| env: | |
| GH_TOKEN: ${{ secrets.GH_TOKEN }} | |
| run: |- | |
| node build.js | |
| cat README.md | |
| - name: Commit and push if changed | |
| run: |- | |
| git diff | |
| git config --global user.email "tw93@qq.com" | |
| git config --global user.name "Tw93-bot" | |
| git pull | |
| git add -A | |
| git commit -m "Updated content" || exit 0 | |
| git push |