Skip to content

Catch errors while dumping #64

Catch errors while dumping

Catch errors while dumping #64

Workflow file for this run

name: build
on:
push:
branches:
- master
workflow_dispatch:
env:
# Task vars
python-version: 3.11
poetry-version: 1.4.0
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Clone code repo
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
python-version: ${{ env.python-version }}
- name: Install poetry
uses: abatilo/[email protected]
with:
poetry-version: ${{ env.poetry-version }}
- name: Download poetry cache
uses: actions/cache@v1
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-2-
- name: Install python dependencies
run: poetry install --no-root
- name: Clone content repo
uses: actions/checkout@v2
with:
repository: newtheatre/history-project
path: content
- name: Download SmugMug cache
uses: actions/cache@v1
with:
path: nthp.smug.db
key: smugmug-1
- name: Fetch SmugMug data if not cached
run: wget -nc https://nthp-seed.s3.eu-west-2.amazonaws.com/nthp.smug.db
- name: Build content database
run: poetry run python nthp load content
- name: Report database stats
run: poetry run python nthp stats
- name: Enrich content database with SmugMug data
env:
SMUGMUG_API_KEY: ${{ secrets.SMUGMUG_API_KEY }}
run: poetry run python nthp smug
- name: Build API
run: poetry run python nthp dump
- name: Deploy to S3
run: bin/deploy.sh
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}