-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub Actions for Mons, Belgium
- Loading branch information
Showing
2 changed files
with
111 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
name: Deploy Mons | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'cities/mons' | ||
|
||
jobs: | ||
build-and-deploy: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
persist-credentials: false | ||
submodules: true | ||
|
||
- name: Install and Build | ||
run: | | ||
npm install | ||
npm run build:mons | ||
env: | ||
MAPBOX_TOKEN: ${{ secrets.MAPBOX_TOKEN }} | ||
|
||
- name: Deploy | ||
uses: JamesIves/[email protected] | ||
with: | ||
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }} | ||
REPOSITORY_NAME: openknowledgebe/equalstreetnames-mons | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: 'dist/mons' # The folder the action should deploy. | ||
CLEAN: true # Automatically remove deleted files from the deploy branch |
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: Update Mons data | ||
|
||
on: | ||
# Run every Monday at 1:00 UTC | ||
schedule: | ||
- cron: "0 1 * * 1" | ||
push: | ||
paths: | ||
- ".github/workflows/update-mons.yml" | ||
- "cities/mons/config.php" | ||
- "cities/mons/overpass/*" | ||
pull_request: | ||
paths: | ||
- ".github/workflows/update-mons.yml" | ||
- "cities/mons/config.php" | ||
- "cities/mons/overpass/*" | ||
|
||
jobs: | ||
update-data: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
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 | ||
run: composer validate | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress --no-suggest | ||
|
||
- name: Checkout submodule to master | ||
working-directory: cities/mons | ||
run: git checkout -q master | ||
- name: Update sub-modules | ||
run: git submodule update --remote --merge cities/mons | ||
|
||
- name: Run update | ||
run: composer run update-data -- --city=mons | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Mons | ||
path: cities/mons/data/* | ||
|
||
- name: Commit sub-module | ||
if: ${{ github.event != 'pull_request' }} | ||
working-directory: cities/mons | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git add data/* | ||
git commit -m "🗃 Update data" | ||
- name: Push to sub-module | ||
uses: ad-m/github-push-action@master | ||
if: ${{ github.event != 'pull_request' }} | ||
with: | ||
github_token: ${{ secrets.ACCESS_TOKEN }} | ||
directory: cities/mons | ||
repository: openknowledgebe/equalstreetnames-mons | ||
- name: Commit repository | ||
if: ${{ github.event != 'pull_request' }} | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
git pull | ||
git add cities/mons | ||
git commit -m "🗃 Update Mons sub-module" | ||
- name: Push to repository | ||
uses: ad-m/github-push-action@master | ||
if: ${{ github.event != 'pull_request' }} | ||
with: | ||
github_token: ${{ secrets.ACCESS_TOKEN }} |