From acde549bf6528fedadf1452501d21abfe0d632b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20Beli=C3=ABn?= Date: Mon, 18 Mar 2024 17:42:58 +0100 Subject: [PATCH] Update update-data.yml --- .github/workflows/update-data.yml | 70 ++----------------------------- 1 file changed, 4 insertions(+), 66 deletions(-) diff --git a/.github/workflows/update-data.yml b/.github/workflows/update-data.yml index 5a6e302..7a8b2c2 100644 --- a/.github/workflows/update-data.yml +++ b/.github/workflows/update-data.yml @@ -1,7 +1,6 @@ name: Update data on: - # Run every month on the 1st at 4:30 UTC schedule: - cron: "30 4 1 * *" push: @@ -17,68 +16,7 @@ on: 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/belgium/mons - run: git checkout -q master - - name: Update sub-modules - run: git submodule update --remote --merge cities/belgium/mons - - - name: Run update - working-directory: process - run: composer run update-data -- --city=belgium/mons - - # - name: Upload artifact - # uses: actions/upload-artifact@v2 - # with: - # name: Mons - # path: cities/belgium/mons/data/* - - - name: Commit sub-module - if: ${{ github.event_name != 'pull_request' }} - working-directory: cities/belgium/mons - 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/belgium/mons - repository: EqualStreetNames/equalstreetnames-mons - - - name: Commit main 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/belgium/mons - git commit -m "🗃 Update Mons sub-module" - - name: Push to main repository - uses: ad-m/github-push-action@master - if: ${{ github.event_name != 'pull_request' }} - with: - github_token: ${{ secrets.ACCESS_TOKEN }} - repository: EqualStreetNames/equalstreetnames + uses: EqualStreetNames/equalstreetnames/.github/workflows/reusable-update-date.yml@master + secrets: inherit + with: + city: belgium/mons