Start parser #225
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: Start parser | |
on: | |
schedule: | |
- cron: 30 5 * * * # Every day at 5:30 UTC (8:30 Europe/KIEV) | |
workflow_dispatch: | |
jobs: | |
start: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Fetch snapshot | |
run: npm run fetch | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'lts/*' | |
cache: 'npm' | |
- name: Install dependencies and start 'serve' script | |
run: npm install | |
- name: Start json-server | |
run: npm run start & | |
- name: Run parser when json-server is ready | |
run: | | |
while ! nc -z localhost 3000; do sleep 1; done | |
npm run scrap | |
- name: Commit changes | |
run: | | |
git config --global user.name '@digitalandyeu-bot' | |
git config --global user.email '[email protected]' | |
git add db.json | |
git commit -m "Added $(date '+%Y-%m-%d') db.json" | |
git push |