Archived
40 lines
1021 B
YAML
40 lines
1021 B
YAML
name: Check and publish image
|
|
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches: [main]
|
|
tags: ["v*"]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
checks:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: astral-sh/setup-uv@v6
|
|
- name: Install locked dependencies
|
|
run: uv sync --locked
|
|
- name: Test
|
|
run: uv run pytest
|
|
- name: Lint
|
|
run: uv run ruff check .
|
|
- name: Type check
|
|
run: uv run mypy src tests
|
|
- name: Build image
|
|
run: docker build --platform linux/amd64 -t recoll-modern:ci .
|
|
|
|
publish:
|
|
needs: checks
|
|
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) }}
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Publish image
|
|
env:
|
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME || github.actor }}
|
|
REGISTRY_TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
|
run: bash scripts/publish_image.sh
|