Skip to content

Commit

Permalink
Add Github Actions Workflow to update City dataset automatically (#48)
Browse files Browse the repository at this point in the history
* Upgrade Workflows to use checkout v4

* Add Workflow to update dataset
  • Loading branch information
stefanzweifel authored May 26, 2024
1 parent f9d7d50 commit d0d5239
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/format_php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
php-cs-fixer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

Expand Down
32 changes: 32 additions & 0 deletions .github/workflows/scheduled-data-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Data Update

on:
workflow_dispatch:
schedule:
- cron: "0 14 20 * *"

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo

- name: Install dependencies
run: composer update --prefer-dist --no-interaction

- name: Update Dataset
run: php app update-cities-dataset

- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
title: 'Cities Dataset has been updated'
branch: data-update
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: main

Expand Down

0 comments on commit d0d5239

Please sign in to comment.