Scheduled Jobs #1183
This file contains hidden or 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
| name: Scheduled Jobs | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| environment: | |
| description: 'the config to use for the Cypress environment' | |
| required: false | |
| default: 'sushi' | |
| schedule: | |
| - cron: "0/15 * * * *" # every 15 minutes | |
| jobs: | |
| # attempts a booking on Tock, but only if it hasn't previously succeeded | |
| attempt_booking: | |
| name: Attempt Booking | |
| runs-on: ubuntu-latest | |
| environment: ${{ github.event.inputs.environment || 'sushi' }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: Mercymeilya/last-workflow-status@v0.3.3 | |
| id: last_status | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-node@v6.2.0 | |
| if: steps.last_status.outputs.last_status != 'success' | |
| with: | |
| node-version-file: .node-version | |
| cache: npm | |
| cache-dependency-path: package-lock.json | |
| - run: echo '${{ secrets.CYPRESS_ENV }}' > cypress.env.json | |
| if: steps.last_status.outputs.last_status != 'success' | |
| - run: npm ci | |
| if: steps.last_status.outputs.last_status != 'success' | |
| - run: npm test | |
| if: steps.last_status.outputs.last_status != 'success' | |
| - uses: gautamkrishnar/keepalive-workflow@v1 # because github will kill this after 60 days | |