Skip to content

Commit 6ff956d

Browse files
committedJan 5, 2021
Add GitHub Actions for Mons, Belgium
1 parent e636b78 commit 6ff956d

File tree

2 files changed

+111
-0
lines changed

2 files changed

+111
-0
lines changed
 

‎.github/workflows/deploy-mons.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
name: Deploy Mons
3+
4+
on:
5+
push:
6+
paths:
7+
- 'cities/mons'
8+
9+
jobs:
10+
build-and-deploy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
persist-credentials: false
17+
submodules: true
18+
19+
- name: Install and Build
20+
run: |
21+
npm install
22+
npm run build:mons
23+
env:
24+
MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }}
25+
26+
- name: Deploy
27+
uses: JamesIves/github-pages-deploy-action@3.6.2
28+
with:
29+
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
30+
REPOSITORY_NAME: openknowledgebe/equalstreetnames-mons
31+
BRANCH: gh-pages # The branch the action should deploy to.
32+
FOLDER: 'dist/mons' # The folder the action should deploy.
33+
CLEAN: true # Automatically remove deleted files from the deploy branch

‎.github/workflows/update-mons.yml

+78
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Update Mons data
2+
3+
on:
4+
# Run every Monday at 1:00 UTC
5+
schedule:
6+
- cron: "0 1 * * 1"
7+
push:
8+
paths:
9+
- ".github/workflows/update-mons.yml"
10+
- "cities/mons/config.php"
11+
- "cities/mons/overpass/*"
12+
pull_request:
13+
paths:
14+
- ".github/workflows/update-mons.yml"
15+
- "cities/mons/config.php"
16+
- "cities/mons/overpass/*"
17+
18+
jobs:
19+
update-data:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
with:
24+
persist-credentials: false
25+
submodules: true
26+
- name: Use PHP 7.4
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: 7.4
30+
extensions: curl, pdo, sqlite3
31+
- name: Validate composer.json and composer.lock
32+
run: composer validate
33+
- name: Install dependencies
34+
run: composer install --prefer-dist --no-progress --no-suggest
35+
36+
- name: Checkout submodule to master
37+
working-directory: cities/mons
38+
run: git checkout -q master
39+
- name: Update sub-modules
40+
run: git submodule update --remote --merge cities/mons
41+
42+
- name: Run update
43+
run: composer run update-data -- --city=mons
44+
45+
- name: Upload artifact
46+
uses: actions/upload-artifact@v2
47+
with:
48+
name: Mons
49+
path: cities/mons/data/*
50+
51+
- name: Commit sub-module
52+
if: ${{ github.event != 'pull_request' }}
53+
working-directory: cities/mons
54+
run: |
55+
git config user.name github-actions
56+
git config user.email github-actions@github.com
57+
git add data/*
58+
git commit -m "🗃 Update data"
59+
- name: Push to sub-module
60+
uses: ad-m/github-push-action@master
61+
if: ${{ github.event != 'pull_request' }}
62+
with:
63+
github_token: ${{ secrets.ACCESS_TOKEN }}
64+
directory: cities/mons
65+
repository: openknowledgebe/equalstreetnames-mons
66+
- name: Commit repository
67+
if: ${{ github.event != 'pull_request' }}
68+
run: |
69+
git config user.name github-actions
70+
git config user.email github-actions@github.com
71+
git pull
72+
git add cities/mons
73+
git commit -m "🗃 Update Mons sub-module"
74+
- name: Push to repository
75+
uses: ad-m/github-push-action@master
76+
if: ${{ github.event != 'pull_request' }}
77+
with:
78+
github_token: ${{ secrets.ACCESS_TOKEN }}

0 commit comments

Comments
 (0)
Failed to load comments.