Skip to content

Merge pull request #27 from justalemon/dependabot/github_actions/dock… #165

Merge pull request #27 from justalemon/dependabot/github_actions/dock…

Merge pull request #27 from justalemon/dependabot/github_actions/dock… #165

Workflow file for this run

name: Lint and Compile
on:
release:
types:
- created
push:
pull_request:
permissions:
# ghcr.io
packages: write
jobs:
lint:
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.12
- run: pip install .[dev]
- run: python -m ruff check --output-format=github .
build:
runs-on: ubuntu-22.04
needs:
- lint
steps:
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
python-version: 3.12
- uses: justalemon/[email protected]
with:
version: 0.0.1-alpha.${{ github.run_number }}
pyproject-files: "pyproject.toml"
initpy-files: "leek/__init__.py"
- run: pip install .[dev]
- run: python -m build
- uses: actions/[email protected]
with:
name: ${{ github.event.repository.name }}
path: dist/*
docker:
runs-on: ubuntu-22.04
needs:
- build
steps:
- uses: actions/[email protected]
- uses: justalemon/[email protected]
with:
version: 0.0.1-alpha.${{ github.run_number }}
pyproject-files: "pyproject.toml"
initpy-files: "leek/__init__.py"
- uses: docker/[email protected]
- uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/[email protected]
id: meta
with:
images: ghcr.io/${{ github.repository }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=sha,format=short,prefix=
type=raw,value=latest,enable={{ is_default_branch }}
- uses: docker/[email protected]
if: ${{ format('refs/heads/{0}', github.event.repository.default_branch) == github.ref || startsWith(github.ref, 'refs/tags/') }}
with:
push: true
tags: ${{ steps.meta.outputs.tags }}