Skip to content

wip: add gha for images #1

wip: add gha for images

wip: add gha for images #1

Workflow file for this run

on:
push:
branches: [ "add-gha-docker-images" ]
workflow_dispatch:
inputs:
version:
description: version of the images
type: string
required: true
default: "1.0" # removeme
grpcio_image_version:
description: version of the grpcio images
type: string
required: true
default: 1.0.0 # removeme
psycopg_version:
description: psycopg version
type: string
required: true
default: 3.1
image_registry:
description: address of the registry
type: string
required: true
default: vayan # removeme
jobs:
alpy_base:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.8.18", "3.9.18", "3.10.13", "3.11.8", "3.12.2" ]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set config variable env
run: |
PYTHON_VERSION=${{ matrix.python-version }}
echo "ALPY_VERSION=${PYTHON_VERSION:0:3}" >> $GITHUB_ENV
echo "HASH_VERSION=${{ hashFiles('requirements.txt', 'docker/alpy/base.Dockerfile') }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/alpy/base.Dockerfile
network: host
no-cache: true
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
tags: |
${{ inputs.image_registry }}/grpcio-alpy${{ env.ALPY_VERSION }}-base:${{ inputs.grpcio_image_version }}-${{ env.HASH_VERSION }}
${{ inputs.image_registry }}/grpcio-alpy${{ env.ALPY_VERSION }}-base:latest
alpy:
runs-on: ubuntu-latest
needs: [ alpy_base ]
strategy:
matrix:
alpy-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set config variable env
run: |
echo "IMG_FULL=${{ inputs.image_registry }}/protoplasm:${{ inputs.version }}-alpy${{ matrix.alpy-version }} >> $GITHUB_ENV
echo "HASH_VERSION=${{ hashFiles('requirements.txt', 'docker/alpy/base.Dockerfile') }}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/alpy/Dockerfile
network: host
no-cache: true
build-args: |
PACKAGE_VERSION=${{ inputs.version }}
BASE_IMAGE="${{ inputs.image_registry }}/grpcio-alpy${{ matrix.alpy-version }}-base:${{ inputs.grpcio_image_version }}-${{ env.HASH_VERSION }}"
tags: |
${{ env.IMG_FULL }}
${{ env.IMG }}:latest-alpy${{ env.ALPY_VERSION }}
alpy_psycopg:
runs-on: ubuntu-latest
needs: [ alpy_base ]
strategy:
matrix:
alpy-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_TOKEN }}
- name: Set config variable env
run: |
echo "IMG_FULL=${{ inputs.image_registry }}/protoplasm:${{ inputs.version }}-alpy${{ matrix.alpy-version }}-psycopg${{ inputs.psycopg_version }} >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: docker/alpy/psycopg.Dockerfile
network: host
no-cache: true
build-args: |
BASE_IMAGE_TAG=${{ inputs.version }}-alpy${{ matrix.alpy-version }}
PSYCOPG_VERSION=${{ inputs.psycopg_version }}
tags: |
${{ env.IMG_FULL }}
# add others