Skip to content

Merge pull request #9 from flowdacity/feat/migrate-env-and-cli-args #12

Merge pull request #9 from flowdacity/feat/migrate-env-and-cli-args

Merge pull request #9 from flowdacity/feat/migrate-env-and-cli-args #12

Workflow file for this run

name: Publish Image
on:
push:
branches: ["main"]
tags: ["*"]
permissions:
contents: read
packages: write
jobs:
test:
name: Run tests before publish
runs-on: ubuntu-latest
services:
redis:
image: redis:7-alpine
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 5s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install uv (with Python 3.12)
uses: astral-sh/setup-uv@v4
with:
python-version: "3.12"
- name: Install dependencies via uv
run: uv sync --group dev
- name: Run tests
run: uv run pytest --cov=fq_server --cov-branch --cov-report=xml
BuildAndPushImage:
name: Build and push image
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/flowdacity/queue-server
tags: |
type=raw,value=dev,enable={{is_default_branch}}
type=ref,event=tag
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max