Files
ticket-monitoring/.github/workflows/docker.yml
T
Aculix Technologies 608221fe18 feat: watch BookMyShow alongside District in one process
BookMyShow sits behind Cloudflare bot management that rejects curl and Node fetch
with 403 on the TLS fingerprint alone, so no header or cookie copying helps and a
proxy makes no difference. impit performs the request with a real Chrome
fingerprint; it ships musl and arm64 binaries, so the Alpine multi-arch image is
unaffected. BMS has no 204 either: a date that is not on sale returns 200 with no
showtimeWidgets key, so 'closed' is read from the payload.

Sites now live in src/providers/, each exposing check() and extract() and returning
one normalized session shape. State is namespaced per site, so each keeps its own
dedupe and failure tracking and neither can silence the other. Alert titles name the
site. Sessions without exact seat counts render without them, which BMS needs.

Old flat District variable names still work. CI now starts the built image and runs
a real check through both providers before publishing, since a broken native binary
only fails at runtime.
2026-08-26 17:50:56 +05:30

70 lines
1.9 KiB
YAML

name: docker
on:
push:
branches: [main]
workflow_dispatch:
concurrency:
group: docker-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm test
publish:
needs: test
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
# QEMU lets this amd64 runner build the arm64 half of the manifest.
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Build amd64 first and actually start it. The native TLS-impersonation binary
# only fails at runtime, so a plain build would happily publish a broken image.
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64
load: true
tags: ticket-monitoring:smoke
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Smoke test the image
run: |
docker run --rm ticket-monitoring:smoke \
node -e "import('impit').then(m => { if (!m.Impit) { throw new Error('impit missing'); } console.log('impit loaded'); })"
docker run --rm --env-file smoke.env ticket-monitoring:smoke \
node src/index.js 2>&1 | tee /tmp/smoke.log
grep -q "\[district\]" /tmp/smoke.log
grep -q "\[bookmyshow\]" /tmp/smoke.log
- uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/${{ github.repository }}:latest
cache-from: type=gha
cache-to: type=gha,mode=max