Skip to content

Booking Action

Booking Action #150

Workflow file for this run

name: Booking Action
env:
ED_USERNAME: ${{ secrets.ED_USERNAME }}
ED_PASSWORD: ${{ secrets.ED_PASSWORD }}
ED_LOGIN_STRATEGIES: ${{ secrets.ED_LOGIN_STRATEGIES }}
CAPTCHA_API_KEY: ${{ secrets.CAPTCHA_API_KEY }}
HOUR_TO_BOOK: ${{ vars.HOUR_TO_BOOK }}
SIGN_IN_URL: ${{ vars.SIGN_IN_URL }}
BOOKING_JSON: ${{ vars.BOOKING_JSON }}
DUMMY_BOOKING_URL: ${{ vars.DUMMY_BOOKING_URL }}
RETRY_INTERVAL: ${{ vars.RETRY_INTERVAL }}
# Controls when the workflow will run
on:
# Triggers the workflow at a certain time
schedule:
- cron: '50 17 * * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Triggers the workflow through a webhook event
repository_dispatch:
types: [booking]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
add-persons:
strategy:
fail-fast: false
matrix:
person: ${{ fromJson(vars.PERSONS) }}
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
# Setup Node
- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
cache: 'npm'
- name: Install dependencies
run: npm ci --prefer-offline --no-audit
- uses: amplium/git-crypt-action@master
with:
key_encoded: ${{ secrets.DECRYPTION_SECRET }}
# Setup FFmpeg
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
# Runs Puppeteer
- name: Run Puppeteer
run: export PERSON="${{ matrix.person }}" && node index.mjs
# Archive Debug Logs
- name: Archive Debug Logs
if: always()
continue-on-error: true
run: tar -czvf "debug-logs-${{ matrix.person }}.tar.gz" "screenshot-before-confirmation.png" "screenshot-after-confirmation.png" "trace-booking.json" "recording-booking.webm"
# Encrypt Debug Logs
- name: Encrypt Debug Logs
if: always()
run: gpg --batch -c --passphrase ${{ secrets.ARTIFACT_ENCRYPTION_PASS }} "debug-logs-${{ matrix.person }}.tar.gz"
# Uploads results
- name: Upload Screenshots
uses: actions/upload-artifact@v3
if: always()
with:
name: Screenshots
path: debug-logs-${{ matrix.person }}.tar.gz.gpg