-
Notifications
You must be signed in to change notification settings - Fork 18
39 lines (35 loc) · 1.26 KB
/
schedule.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
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@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'
- uses: gautamkrishnar/keepalive-workflow@v1 # because github will kill this after 60 days