name: Update location

on:
  schedule:
    - cron: '*/5 * * * *'

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - name: Install Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '>=13.0'
      - name: Check location
        id: location
        run: ./scripts/check-location.js
      - name: Install build dependencies
        if: steps.location.outputs.updated
        run: yarn install --production
      - name: Update location
        if: steps.location.outputs.updated
        run: ./scripts/update-location.js
        env:
          GMAPS_TOKEN: ${{ secrets.GMAPS_TOKEN }}
      - name: Build static files
        if: steps.location.outputs.updated
        run: yarn build
      - name: Install Google Cloud
        if: steps.location.outputs.updated
        uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
        with:
          version: '274.0.1'
          service_account_key: ${{ secrets.GCLOUD_AUTH }}
      - name: Deploy files
        if: steps.location.outputs.updated
        run: yarn run ssdeploy deploy
        env:
          FORCE_COLOR: 2
          GCLOUD_APP: ${{ secrets.GCLOUD_APP }}
          GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
          CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
          CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}

name: Update location

on:
  schedule:
    - cron: '*/15 * * * *'

jobs:
  update:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the repository
        uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - name: Install Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '>=13.0'
      - name: Check location
        id: location
        run: ./scripts/check-location.js
      - name: Install build dependencies
        if: steps.location.outputs.updated
        run: yarn install --production
      - name: Update location
        if: steps.location.outputs.updated
        run: ./scripts/update-location.js
        env:
          GMAPS_TOKEN: ${{ secrets.GMAPS_TOKEN }}
      - name: Build static files
        if: steps.location.outputs.updated
        run: yarn build
      - name: Install Google Cloud
        if: steps.location.outputs.updated
        uses: GoogleCloudPlatform/github-actions/setup-gcloud@master
        with:
          version: '274.0.1'
          service_account_key: ${{ secrets.GCLOUD_AUTH }}
      - name: Deploy files
        if: steps.location.outputs.updated
        run: yarn run ssdeploy deploy
        env:
          FORCE_COLOR: 2
          GCLOUD_APP: ${{ secrets.GCLOUD_APP }}
          GCLOUD_PROJECT: ${{ secrets.GCLOUD_PROJECT }}
          CLOUDFLARE_ZONE: ${{ secrets.CLOUDFLARE_ZONE }}
          CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}

Check location every 15 minutes
Check location every 15 minutes
