free-programming-books-parse #937
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: free-programming-books-parse | |
on: | |
workflow_dispatch: | |
inputs: | |
reason: | |
required: true | |
default: "update json files" | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout self | |
uses: actions/checkout@v2 | |
with: | |
path: json | |
- name: Checkout programming books | |
uses: actions/checkout@v2 | |
with: | |
repository: EbookFoundation/free-programming-books | |
path: fpb | |
- name: Checkout parser | |
uses: actions/checkout@v2 | |
with: | |
repository: EbookFoundation/free-programming-books-parser | |
path: parser | |
- name: Use Node.js | |
uses: actions/setup-node@v1 | |
with: | |
node-version: '14.x' | |
- run: npm install -g https://github.com/EbookFoundation/free-programming-books-parser | |
- run: fpb-parse --output ./json/fpb.json | |
- name: Commit Changes | |
run: | | |
cd './json' | |
git config user.name 'github-actions[bot]' | |
git config user.email 'github-actions[bot]@users.noreply.github.com' | |
git add -f 'fpb.json' | |
git commit -m "update fpb.json" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
directory: "./json" |