Skip to content

Generate Blog

Generate Blog #146

Workflow file for this run

name: Generate Blog
# on:
# workflow_run:
# workflows: ["Deploy to Github Pages"]
# types:
# - completed
on:
schedule:
- cron: '0 0 * * *'
# on:
# push:
# branches: [ master ]
# delete:
# branches: [ master ]
# create:
# branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Install dependencies
run: npm install
- name: Generate blog
run: python .github/scripts/update_readme.py
- name: Check for changes
id: changes
run: |
if git diff --quiet HEAD -- README.md; then
echo "::set-output name=has_changes::false"
else
echo "::set-output name=has_changes::true"
fi
- name: Commit and push changes
if: steps.changes.outputs.has_changes == 'true'
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add README.md
git commit -m "Generate blog for today"
git push