generated from EqualStreetNames/equalstreetnames-template
-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (77 loc) · 2.7 KB
/
update-data.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: Update data
on:
# Run every month on the 2nd at 13:30 UTC
schedule:
- cron: "0 21 2 * *"
push:
paths:
- ".github/workflows/update-data.yml"
- "config.php"
- "overpass/*"
pull_request:
paths:
- ".github/workflows/update-data.yml"
- "config.php"
- "overpass/*"
jobs:
update-data:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: EqualStreetNames/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/germany/hannover
run: git checkout -q master
- name: Update sub-modules
run: git submodule update --remote --merge cities/germany/hannover
- name: Run update
working-directory: process
run: composer run update-data -- --city=germany/hannover
# - name: Upload artifact
# uses: actions/upload-artifact@v2
# with:
# name: Hannover
# path: cities/germany/hannover/data/*
- name: Commit sub-module
if: ${{ github.event_name != 'pull_request' }}
working-directory: cities/germany/hannover
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/germany/hannover
repository: EqualStreetNames/equalstreetnames-hannover
- 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/germany/hannover
git commit -m "🗃 Update Hannover 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: EqualStreetNames/equalstreetnames