diff --git a/.github/workflows/format_php.yml b/.github/workflows/format_php.yml index 0ef2144..c02e081 100644 --- a/.github/workflows/format_php.yml +++ b/.github/workflows/format_php.yml @@ -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 }} diff --git a/.github/workflows/scheduled-data-update.yml b/.github/workflows/scheduled-data-update.yml new file mode 100644 index 0000000..521233b --- /dev/null +++ b/.github/workflows/scheduled-data-update.yml @@ -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 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c4445e3..a171ff2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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 diff --git a/.github/workflows/update-changelog.yaml b/.github/workflows/update-changelog.yaml index c20834c..a4e024b 100644 --- a/.github/workflows/update-changelog.yaml +++ b/.github/workflows/update-changelog.yaml @@ -10,7 +10,7 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: ref: main