Files
Mind-Expanding-Books/.github/workflows/updatejson.yml
PhilipWright96 e86b26a72e Make book reviews up to date (#321)
* Fix import typo

* Fix import typo

* Add yml file to schedule github action

* Undo import changes

* Formatting

* Fix imports

* Imports

* Add file extension

* Kick on branch

* Try using py

* Attempt adding semicolons

* Temporarily remove python call

* Remove space

* Leave only one line in

* Refactor syntax

* Update yml syntax

* Test

* Test

* Test

* Test

* Add import

* Add bs4 module

* Refactor yml

* Add missing quotation marks

* Cat newly created file for testing purposes

* Sort indents

* Properly sort indents

* Add extra import

* Update import

* Update JSON files

* Use secrets for API keys

* Update json

* Update JSON files

* Reorganize workflow

* Move into right directory

* Fix order

* Update JSON files

* Attempt to change account which makes commits

* Kick job

* Update JSON files

* Attempt commit with new bot email

* Kick

* Attempt new kick

* Update JSON files

* Attempt removing email

* Change for kick

* Update JSON files

* Re-add email

* Update JSON files

* Check pwd of github VM

* Update JSON files

* Attempt copying updating books.json to app data

* Update JSON files

* Remove the onpush setting

* Update install method

* Replace touch with just echo call

* Update JSON files

* Remove cat

* Rename email

* Stage individual files instead of all

* Update JSON files

Co-authored-by: Philip Wright <wrightphilip4@gmail.com.github.com>
Co-authored-by: Mind Expanding Books Bot <mindexpandingbooks@gmail.com.github.com>
Co-authored-by: mindexpandingbooksbot <runner@fv-az70-910.gpy01byny0buvbolry2rpgzvkd.bx.internal.cloudapp.net>
Co-authored-by: mindexpandingbooksbot <mindexpandingbooksbot@users.noreply.github.com>
2020-11-30 00:06:31 +05:30

36 lines
1.3 KiB
YAML

name: Housekeeping
on:
push:
schedule:
# Kick off job at midnight on the 1st and the 15th of every month
- cron: "0 0 1,15 * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- name: Run Python script
run: |
cd utils
pip install requests bs4 google
echo "GOODREADS_PUBLIC_API_KEY = ${{ secrets.GOODREADS_PUBLIC_API_KEY}}
GOOGLE_SEARCH_RAPIDAPI_HOST = ${{ secrets.GOOGLE_SEARCH_RAPIDAPI_HOST}}
GOOGLE_SEARCH_RAPIDAPI_KEY = ${{ secrets.GOOGLE_SEARCH_RAPIDAPI_KEY}}
GOOGLE_BOOK_API_KEY = ${{ secrets.GOOGLE_BOOK_API_KEY}}" > config.py
python update_json_files.py
cp /home/runner/work/Mind-Expanding-Books/Mind-Expanding-Books/utils/books.json /home/runner/work/Mind-Expanding-Books/Mind-Expanding-Books/app/src/data
cd ..
- name: Run git commands
run: |
git add app/src/data/books.json
git add utils/book_name_to_details.json
git add utils/books.json
git config --global user.name 'mindexpandingbooksbot'
git config --global user.email 'mindexpandingbooksbot@users.noreply.github.com'
git commit -am 'Update JSON files'
git push