Export local plan data #13
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: Export local plan data | |
on: | |
schedule: | |
- cron: '0 1 * * *' | |
workflow_dispatch: | |
jobs: | |
run-data-export: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Download csv files | |
run: | | |
curl -o data/export/local-plan.csv https://local-plans-explorer.digital-land.info/export/local-plan.csv | |
curl -o data/export/local-plan-document.csv https://local-plans-explorer.digital-land.info/export/local-plan-document.csv | |
curl -o data/export/local-plan-timetable.csv https://local-plans-explorer.digital-land.info/export/local-plan-timetable.csv | |
curl -o data/export/local-plan-boundary.csv https://local-plans-explorer.digital-land.info/export/local-plan-boundary.csv | |
- name: Set up git | |
run: | | |
git config --global user.name 'github-actions[bot]' | |
git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
- name: Commit and push changes | |
run: | | |
git add data | |
if ! git diff-index --quiet HEAD --; then | |
git commit -m "Updated local plans specification csv files" | |
git push | |
else | |
echo "No changes to commit" | |
fi | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |