README builder #3603
This file contains 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: README builder | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 */6 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v1 | |
- name: Install packages | |
run: npm install | |
- name: (Re)build README | |
run: npm --silent run build > README.md | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Check for changes (fail if none) | |
run: | | |
! git diff --quiet | |
- name: Commit changes if required | |
if: ${{ success() }} | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "jung-thomas" | |
git add README.md | |
git commit -m 'update README' || exit 0 | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |