Skip to content

Commit

Permalink
Update update-data.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jbelien authored Mar 18, 2024
1 parent afe87e7 commit 151e65b
Showing 1 changed file with 6 additions and 62 deletions.
68 changes: 6 additions & 62 deletions .github/workflows/update-data.yml
Original file line number Diff line number Diff line change
@@ -1,81 +1,25 @@
name: Update data

on:
# Run every month on the 2nd at 6:00 UTC
schedule:
- cron: "0 6 2 * *"
workflow_dispatch:
push:
paths:
- ".github/workflows/update-data.yml"
- "config.php"
- "data.csv"
- "overpass/*"
pull_request:
paths:
- ".github/workflows/update-data.yml"
- "config.php"
- "data.csv"
- "overpass/*"

jobs:
update-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ github.repository_owner }}/equalstreetnames
persist-credentials: false
submodules: true

- name: Validate composer.json and composer.lock
working-directory: process
run: composer validate
- name: Install dependencies
working-directory: process
run: composer install --prefer-dist --no-progress

- name: Checkout submodule to master
working-directory: cities/poland/chorzow
run: git checkout -q master
- name: Update sub-modules
run: git submodule update --remote --merge cities/poland/chorzow

- name: Run update
working-directory: process
run: composer run update-data -- --city=poland/chorzow

# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: Chorzów
# path: cities/poland/chorzow/data/*

- name: Commit sub-module
if: ${{ github.event_name != 'pull_request' }}
working-directory: cities/poland/chorzow
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git add data/*
git commit -m "🗃 Update data"
- name: Push to sub-module
uses: ad-m/github-push-action@master
if: ${{ github.event_name != 'pull_request' }}
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
directory: cities/poland/chorzow
repository: ${{ github.repository }}

- name: Commit main repository
if: ${{ github.event_name != 'pull_request' }}
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git pull
git add cities/poland/chorzow
git commit -m "🗃 Update Chorzów sub-module"
- name: Push to main repository
uses: ad-m/github-push-action@master
if: ${{ github.event_name != 'pull_request' }}
with:
github_token: ${{ secrets.ACCESS_TOKEN }}
repository: ${{ github.repository_owner }}/equalstreetnames
uses: EqualStreetNames/equalstreetnames/.github/workflows/reusable-update-date.yml@master
secrets: inherit
with:
city: poland/chorzow

0 comments on commit 151e65b

Please sign in to comment.