Skip to content

push-poetry-container #39

push-poetry-container

push-poetry-container #39

name: push-poetry-container
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-ci
POETRY_VERSION: 1.3.2
PYTHON_PRIMARY_VERSION: 3.8.16
PYTHON_PRIMARY_TAG: py38
PYTHON_SECONDARY_VERSION: 3.10.9
PYTHON_SECONDARY_TAG: py310
DEBIAN_VERSION: bullseye
on:
push:
paths:
- .devcontainer/Dockerfile
branches:
- devel
workflow_dispatch:
jobs:
push-poetry-container:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Login to GCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Metadata
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Echo
run: |
echo "USER: ${{ github.actor }}"
echo "REPOSITORY: ${{ github.repository }}"
echo "POETRY_VERSION: ${POETRY_VERSION}"
echo "PYTHON_PRIMARY_VERSION: ${PYTHON_PRIMARY_VERSION}"
echo "PYTHON_SECONDARY_VERSION: ${PYTHON_SECONDARY_VERSION}"
echo "TAGS: ${{ steps.meta.outputs.tags }}"
echo "LABELS: ${{ steps.meta.outputs.labels }}"
- name: Image - poetry${{ env.POETRY_VERSION }}-python${{ env.PYTHON_PRIMARY_VERSION }}
uses: docker/build-push-action@v3
with:
file: ./.devcontainer/Dockerfile
push: true
build-args: |
PYTHON_VERSION=${{ env.PYTHON_PRIMARY_VERSION }}
POETRY_VERSION=${{ env.POETRY_VERSION }}
DEBIAN_VERSION=${{ env.DEBIAN_VERSION }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PYTHON_PRIMARY_TAG }}-poetry-${{ env.DEBIAN_VERSION }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:python${{ env.PYTHON_PRIMARY_VERSION }}-poetry${{ env.POETRY_VERSION }}-${{ env.DEBIAN_VERSION }}
labels: ${{ steps.meta.outputs.labels }}
- name: Image - poetry${{ env.POETRY_VERSION }}-python${{ env.PYTHON_SECONDARY_VERSION }}
uses: docker/build-push-action@v3
with:
file: ./.devcontainer/Dockerfile
push: true
build-args: |
PYTHON_VERSION=${{ env.PYTHON_SECONDARY_VERSION }}
POETRY_VERSION=${{ env.POETRY_VERSION }}
DEBIAN_VERSION=${{ env.DEBIAN_VERSION }}
tags: |
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.PYTHON_SECONDARY_TAG }}-poetry-${{ env.DEBIAN_VERSION }}
${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:python${{ env.PYTHON_SECONDARY_VERSION }}-poetry${{ env.POETRY_VERSION }}-${{ env.DEBIAN_VERSION }}
labels: ${{ steps.meta.outputs.labels }}