Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/publish-ghcr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Publish to GHCR

on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to the Container registry
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,4 @@ dist/
*.orig
terraform.tfstate
terraform.tfstate.*
actionlint
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,18 @@ This FastAPI service exposes lightweight endpoints for both coarse X-ray typing
## Utilities

- `BFD9020.html` – browser tester that runs all endpoints in sequence. When the API is running visit `/test`; otherwise open the file locally and point it to a remote base URL. TIFF previews are decoded client-side via vendored `pako` + `UTIF` scripts exposed from `/static`.

## Local Docker Workflow

- Build the image standalone: `docker build -t bfd9020:test .` from the repo root.
- Run the container directly: `docker run --rm -p 9020:9020 bfd9020:test`.
- Or use the provided `docker-compose.yml` for a one-liner: `docker compose up --build` (press `Ctrl+C` to stop).
- Hit `http://localhost:9020` or open `BFD9020.html` and point it at the local API to verify endpoints.

## Release Process (git-flow)

- Start a release branch from `develop`: `git flow release start vX.Y.Z` (use SemVer).
- Update release artifacts (docs, changelog) and ensure tests pass; no hard-coded version file exists, so choosing the new SemVer is enough.
- Finish the release to merge into `main` and back into `develop`: `git flow release finish vX.Y.Z`.
- Push updated branches and the annotated tag: `git push origin main develop --tags`.
- Pushing the tag triggers the GHCR workflow, producing images tagged with the SemVer and branch/SHA variants.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
services:
api:
image: ghcr.io/open-ortho/edu.case.bfd9020:local
build:
context: .
dockerfile: Dockerfile
Expand Down