Skip to content

Commit

Permalink
Move scrape_book_types into deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
object-Object committed Jan 2, 2024
1 parent 283e96e commit 674e218
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 66 deletions.
55 changes: 40 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,55 @@ env:
CDK_IAM_ROLE_ARN: arn:aws:iam::511603859520:role/prod-objectobject-ca-GitHubActionsCDKRole19D97701-sweSB0Sp33WN

jobs:
build:
scrape_book_types:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true

- uses: actions/setup-python@v4
submodules: "recursive"

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: pip
cache: "pip"

- name: Install Python packages
run: pip install . hatch
- name: Install Python deps
run: pip install -e .

# we use a GitHub deployment for this, so there's no artifact upload
# the build is just to see if it breaks or not
- name: Build wheel
run: hatch build --target wheel
- name: Scrape book types
run: |
python scrape_book_types.py > book_types.py.new
mv book_types.py.new src/HexBug/utils/book_types.py
ruff format src/HexBug/utils/book_types.py
ruff check --select=I --fix src/HexBug/utils/book_types.py
- name: Commit updated book types
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update book types

- name: Dump patterns
run: python dump_patterns.py patterns.csv.new

- name: Check out gh-pages
uses: actions/checkout@v3
with:
clean: false
ref: gh-pages

- name: Overwrite file
run: mv patterns.csv.new patterns.csv

- name: Commit updated pattern dump
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update pattern dump
file_pattern: patterns.csv

deploy-aws-cdk:
needs: build
needs: scrape_book_types
runs-on: ubuntu-latest
environment:
name: prod-aws-cdk
Expand Down
51 changes: 0 additions & 51 deletions .github/workflows/scrape_book_types.yml

This file was deleted.

0 comments on commit 674e218

Please sign in to comment.