Merge pull request #48 from smkent/manage-cookie #86
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
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/[email protected] | |
with: | |
registry: ${{ env.REGISTRY }} | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: π‘ Collect image metadata | |
id: meta | |
uses: docker/[email protected] | |
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/[email protected] | |
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 }}" |