Skip to content

Initial commit

Initial commit #8

Workflow file for this run

name: CI
on:
push:
pull_request:
env:
IMAGE_NAME: ${{ github.repository }}
jobs:
ruff_lint:
name: Ruff Lint
runs-on: ubuntu-latest
continue-on-error: ${{ github.ref != 'refs/heads/main' && !(github.event_name == 'pull_request' && github.base_ref == 'main') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run Ruff
uses: astral-sh/ruff-action@v3
with:
version: "0.14.2"
args: "check --config pyproject.toml qazpt"
pip_audit:
name: pip-audit
runs-on: ubuntu-latest
continue-on-error: ${{ github.ref != 'refs/heads/main' && !(github.event_name == 'pull_request' && github.base_ref == 'main') }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.14"
- name: Run pip-audit
uses: pypa/gh-action-pip-audit@v1.1.0
with:
inputs: .
build_and_push:
name: Build and Push Docker Image
runs-on: ubuntu-latest
needs: [ruff_lint, pip_audit]
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=raw,value=latest
type=sha
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max