ratchagitja scraper #216
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: ratchagitja scraper | |
on: | |
schedule: | |
- cron: "0 0 * * *" # every day at midnight | |
workflow_dispatch: | |
jobs: | |
scrape-extract: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "npm" | |
cache-dependency-path: ./scraper/package-lock.json | |
- run: npm install | |
working-directory: ./scraper | |
- run: npm run scrape | |
working-directory: ./scraper | |
env: | |
FB_TOKEN: ${{ secrets.FB_TOKEN }} | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
cache: "npm" | |
cache-dependency-path: ./extractor/package-lock.json | |
- run: npm install | |
working-directory: ./extractor | |
- run: npm run extract | |
working-directory: ./extractor | |
- name: commit file | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "ratchagitja" | |
git add ./data/ratchakitcha*.csv | |
git add ./entries/**/*.md | |
if ! git diff-index --quiet HEAD ./data/ratchakitcha*.csv; then | |
git commit -m "docs: auto update ratchakitcha" | |
git push | |
fi |