Skip to content

Added github container build step #17

Added github container build step

Added github container build step #17

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.11
- 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.11
- uses: justalemon/[email protected]
with:
version: 0.0.1-alpha.${{ github.run_number }}
pyproject-files: "pyproject.toml"
- 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: 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]
- 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 }}