Skip to content

Update project template cruft, dependencies #123

Update project template cruft, dependencies

Update project template cruft, dependencies #123

Workflow file for this run

---
name: Build
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
RELEASE_PYTHON_VERSION: "3.12"
RELEASE_POETRY_VERSION: "1.6"
on:
pull_request:
push:
branches:
- '*'
tags:
- 'v*'
workflow_dispatch:
jobs:
Container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: 💾 Check out repository
uses: actions/checkout@v3
- name: 🔑 Log in to the container registry
uses: docker/login-action@v2.1.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: 📡 Collect image metadata
id: meta
uses: docker/metadata-action@v4.3.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}},enable=${{ !startsWith(github.ref, 'refs/tags/v0.') }}
type=edge,branch=main
- name: 🐍 Set up Python project with Poetry
uses: ./.github/workflows/actions/python-poetry
with:
python_version: ${{ env.RELEASE_PYTHON_VERSION }}
poetry_version: ${{ env.RELEASE_POETRY_VERSION }}
- name: 🔥 Test
run: poetry run poe test
- name: 📦 Build and publish container image
uses: docker/build-push-action@v4.0.0
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
"POETRY_DYNAMIC_VERSIONING_BYPASS=${{ env.PROJECT_VERSION }}"