Scheduled Jobs #50
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 17 * * *" | |
| 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@v3 | |
| - uses: Mercymeilya/last-workflow-status@v0.3.3 | |
| id: last_status | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-node@v3 | |
| 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' |