Skip to content

Instantly share code, notes, and snippets.

@lifeparticle
Created January 26, 2021 13:34
Show Gist options
  • Save lifeparticle/5b5833badce54126f6e280ab49053153 to your computer and use it in GitHub Desktop.
Save lifeparticle/5b5833badce54126f6e280ab49053153 to your computer and use it in GitHub Desktop.
name: Build Json
on:
push:
branches:
- main
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Update json
run: |-
python build_json.py
cat blog_links.json
- name: Commit and push if changed
run: |-
git diff
git config --global user.email "json-bot@example.com"
git config --global user.name "json-bot"
git add -A
git commit -m "Updated content" || exit 0
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment