Skip to content

wip: add gha for images #2

wip: add gha for images

wip: add gha for images #2

Workflow file for this run

name: Publish Docker Images (Alpy)
on:
push:
branches: [ "add-gha-docker-images" ]
workflow_dispatch:
# fixme
env:
PROTOPLASM_PY_PKG_VERSION: "5.0.0"
GRPCIO_IMAGE_VERSION: "1.0.0"
PSYCOPG_VERSION: "3.1"
IMAGE_REGISTRY: "vayan"
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: |
ALPY_VERSION=`echo ${{ matrix.python-version }} | cut -d. -f1,2`
echo "ALPY_VERSION=$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/base.Dockerfile
network: host
no-cache: true
push: true
build-args: |
PYTHON_VERSION=${{ matrix.python-version }}
tags: |
${{ env.IMAGE_REGISTRY }}/grpcio-alpy${{ env.ALPY_VERSION }}-base:${{ env.GRPCIO_IMAGE_VERSION }}-${{ env.HASH_VERSION }}
${{ env.IMAGE_REGISTRY }}/grpcio-alpy${{ env.ALPY_VERSION }}-base:latest
alpy:
runs-on: ubuntu-latest
needs: [ alpy_base ] # TODO also needs protoplasm release
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=${{ env.IMAGE_REGISTRY }}/protoplasm:${{ env.PROTOPLASM_PY_PKG_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
push: true
build-args: |
PACKAGE_VERSION=${{ env.PROTOPLASM_PY_PKG_VERSION }}
BASE_IMAGE=${{ env.IMAGE_REGISTRY }}/grpcio-alpy${{ matrix.alpy-version }}-base:${{ env.GRPCIO_IMAGE_VERSION }}-${{ env.HASH_VERSION }}
tags: |
${{ env.IMG_FULL }}
${{ env.IMAGE_REGISTRY }}/protoplasm:latest-alpy${{ env.ALPY_VERSION }}
alpy_psycopg:
runs-on: ubuntu-latest
needs: [ alpy ]
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=${{ env.IMAGE_REGISTRY }}/protoplasm:${{ env.PROTOPLASM_PY_PKG_VERSION }}-alpy${{ matrix.alpy-version }}-psycopg${{ env.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
push: true
build-args: |
BASE_IMAGE=${{ env.IMAGE_REGISTRY }}/protoplasm:${{ env.PROTOPLASM_PY_PKG_VERSION }}-alpy${{ matrix.alpy-version }}
PSYCOPG_VERSION=${{ env.PSYCOPG_VERSION }}
tags: |
${{ env.IMG_FULL }}
${{ env.IMAGE_REGISTRY }}/protoplasm:latest-alpy${{ matrix.alpy-version }}-psycopg${{ env.PROTOPLASM_PY_PKG_VERSION }}
${{ env.IMAGE_REGISTRY }}/protoplasm:latest-alpy${{ matrix.alpy-version }}-psycopg