.github/workflows/scrape.yml #9778
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
on: | |
push: | |
workflow_dispatch: | |
schedule: | |
- cron: '2 * * * *' # every 1 hour for now | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out this repo | |
uses: actions/checkout@v2 | |
- name: Fetch latest data from the API endpoint | |
run: |- | |
curl -s "https://hub.docker.com/v2/repositories/dustynv/?page=1&page_size=1000" | jq '.results'> dockerhub.json | |
- name: Commit and push if the data has changed | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add -A | |
timestamp=$(date -u) | |
git commit -m "Latest data: ${timestamp}" || exit 0 | |
git push |