Coerce types to match when dealing with ties

Also add a rudimentary publication workflow, as I'm migrating away from
Drone - see [here](https://blog.scubbo.org/posts/gitea-actions/).
This commit is contained in:
Jack Jackson 2025-04-05 14:43:11 -07:00
parent 16c4d20b63
commit c53e2aafc5
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,50 @@
name: Publish
on:
push:
branches:
- main
jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- name: Import Secrets
id: import-secrets
uses: hashicorp/vault-action@v2
with:
url: http://vault.avril
method: kubernetes
# TODO - when https://github.com/go-gitea/gitea/pull/33945 is merged, instead use per-workflow OIDC-based auth
role: act-runner-helm-charts
secrets: |
shared-secrets/gitea/pat_to_push_images token | GITEA_TOKEN
- name: Login to Gitea
uses: docker/login-action@v3
with:
username: scubbo
password: ${{ env.GITEA_TOKEN }}
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push image
uses: docker/build-push-action@v3
with:
context: .
file: Dockerfile
target: prod
push: true
platforms: linux/amd64,linux/arm64
tags: |
scubbo/edh-elo:${{ gitea.sha }}
scubbo/edh-elo:latest
- name: Output
run: |
echo "Image pushed: scubbo/edh-elo:${{ gitea.sha }}"
# TODO - update Helm chart with new image

View File

@ -54,7 +54,7 @@ def create_game(game: schemas.GameCreate, db: Session = Depends(get_db)):
if game.other_winning_deck_ids:
winning_deck_ids.extend(
[
deck_ids.index(other_winning_id)
deck_ids.index(int(other_winning_id))
for other_winning_id in game.other_winning_deck_ids.split(",")
]
)