Skip to content

Hackney Cinema Calendar #177

Hackney Cinema Calendar

Hackney Cinema Calendar #177

Workflow file for this run

on:
workflow_dispatch:
inputs:
tagSuffix:
description: 'Tag Suffix'
required: true
default: '1'
type: choice
options:
- '1'
- '2'
- '3'
- '4'
- '5'
schedule:
- cron: '0 3 * * *' # every morning at 3am UTC
name: Hackney Cinema Calendar
jobs:
generate_calendar:
name: Generate Calendar
runs-on: ubuntu-latest
permissions:
contents: write
env:
MOVIEDB_API_KEY: ${{ secrets.MOVIEDB_API_KEY }}
steps:
# Setup
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: .node-version
- run: npm ci
- run: npx playwright install --with-deps
- name: Get current date and time
id: date
run: |
echo "currentDate=$(TZ=Europe/London date +'%Y-%m-%d')" >> "$GITHUB_OUTPUT"
echo "currentTime=$(TZ=Europe/London date +'%H:%M:%S')" >> "$GITHUB_OUTPUT"
# BFI runs needs a full browser and are flaky, so retry if they initially fail
- name: npm run generate bfi.org.uk-imax
uses: nick-fields/retry@v3
with:
timeout_minutes: 15
retry_wait_seconds: 30
max_attempts: 10
command: xvfb-run npm run generate bfi.org.uk-imax
- name: npm run generate bfi.org.uk-southbank
uses: nick-fields/retry@v3
with:
timeout_minutes: 30
retry_wait_seconds: 60
max_attempts: 10
command: xvfb-run npm run generate bfi.org.uk-southbank
# All other cinema site runs use data which can be fetched
- run: npm run generate princecharlescinema.com
- run: npm run generate genesiscinema.co.uk
- run: npm run generate thecastlecinema.com
- run: npm run generate picturehouses.com-central
- run: npm run generate picturehouses.com-clapham
- run: npm run generate picturehouses.com-crouch-end
- run: npm run generate picturehouses.com-ealing
- run: npm run generate picturehouses.com-east-dulwich
- run: npm run generate picturehouses.com-greenwich
- run: npm run generate picturehouses.com-finsbury-park
- run: npm run generate picturehouses.com-hackney
- run: npm run generate picturehouses.com-the-gate
- run: npm run generate picturehouses.com-the-ritzy
- run: npm run generate picturehouses.com-west-norwood
- run: npm run generate riocinema.org.uk
- run: npm run generate regentstreetcinema.com
- run: npm run generate phoenixcinema.co.uk
- run: npm run generate electriccinema.co.uk-portobello
- run: npm run generate electriccinema.co.uk-white-city
- name: Save any test failure artifacts
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-failures
path: ./playwright-failures
if-no-files-found: ignore
retention-days: 7
# Run post-data scripts
- run: npm run output:highlight-hydration-misses-for-review
# Create release with assets
- uses: ncipollo/release-action@v1
id: release
with:
allowUpdates: false
artifactErrorsFailBuild: true
artifacts: "output/*.ics,output/*.json,schema.json"
makeLatest: true
tag: ${{ steps.date.outputs.currentDate }}.${{ inputs.tagSuffix || '0' }}
commit: main
body: |
Calendar and data files generated at ${{ steps.date.outputs.currentTime }} on ${{ steps.date.outputs.currentDate }}
Created by job ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Output summary
run: |
echo "📆 Calendar generated at ${{ steps.date.outputs.currentTime }} on ${{ steps.date.outputs.currentDate }}" >> $GITHUB_STEP_SUMMARY
echo "🔖 New release - ${{ steps.release.outputs.html_url }}" >> $GITHUB_STEP_SUMMARY