forked from azoff/tockstalk
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (45 loc) · 1.71 KB
/
schedule.yml
File metadata and controls
54 lines (45 loc) · 1.71 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Scheduled Jobs
on:
workflow_dispatch:
inputs:
environment:
description: 'The config to use for the Cypress environment'
required: false
default: 'sushi'
schedule:
- cron: "*/1 * * * *" # every minute
jobs:
attempt_booking:
name: Attempt Booking
runs-on: ubuntu-latest
environment: ${{ github.event.inputs.environment || 'sushi' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Check last workflow status
uses: Mercymeilya/last-workflow-status@v0.3.3
id: last_status
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Node.js
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
- name: Set up Cypress environment
run: echo '${{ secrets.CYPRESS_ENV }}' > cypress.env.json
if: steps.last_status.outputs.last_status != 'success'
- name: Install dependencies
run: npm ci
if: steps.last_status.outputs.last_status != 'success'
- name: Run Booking Script with Proxy
run: npm test
env:
# Set proxy only for this step
HTTP_PROXY: "http://${{ secrets.PROXY_USER }}:${{ secrets.PROXY_PASSWORD }}@gate.nodemaven.com:8080"
HTTPS_PROXY: "http://${{ secrets.PROXY_USER }}:${{ secrets.PROXY_PASSWORD }}@gate.nodemaven.com:8080"
NO_PROXY: "localhost,127.0.0.1"
if: steps.last_status.outputs.last_status != 'success'
- uses: gautamkrishnar/keepalive-workflow@v1 # because GitHub will kill this after 60 days