generated from EqualStreetNames/equalstreetnames-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
67 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,25 @@ | ||
name: Update data | ||
|
||
on: | ||
# Run every month on the 2nd at 7:00 UTC | ||
schedule: | ||
- cron: "0 7 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/*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
update-data: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
repository: ${{ github.repository_owner }}/equalstreetnames | ||
persist-credentials: false | ||
submodules: true | ||
- name: Use PHP 7.4 | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: 7.4 | ||
extensions: curl, pdo, sqlite3 | ||
- 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/switzerland/bern | ||
run: git checkout -q master | ||
- name: Update sub-modules | ||
run: git submodule update --remote --merge cities/switzerland/bern | ||
|
||
- name: Run update | ||
working-directory: process | ||
run: composer run update-data -- --city=switzerland/bern | ||
|
||
# - name: Upload artifact | ||
# uses: actions/upload-artifact@v2 | ||
# with: | ||
# name: Bern | ||
# path: cities/switzerland/bern/data/* | ||
|
||
- name: Commit sub-module | ||
if: ${{ github.event_name != 'pull_request' }} | ||
working-directory: cities/switzerland/bern | ||
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/switzerland/bern | ||
repository: ${{ github.repository }} | ||
|
||
- name: Commit 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/switzerland/bern | ||
git commit -m "🗃 Update Bern sub-module" | ||
- name: Push to 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: switzerland/bern |