Skip to content

Docker Base: Setup vim for all python vesions #5

Docker Base: Setup vim for all python vesions

Docker Base: Setup vim for all python vesions #5

name: Build and Push Base Docker Image
on:
push:
branches: [main, master, develop]
paths:
- 'Dockerfile.base'
- '.github/workflows/build_base_image.yml'
workflow_dispatch:
jobs:
build-and-push-base:
runs-on: ubuntu-latest
strategy:
matrix:
pyver: ["3.10.13", "3.11.9", "3.12.4", "3.13.0"]
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract repo name
id: repo
run: |
echo "REPO=${GITHUB_REPOSITORY,,}" >> $GITHUB_OUTPUT
- name: Extract short Python version
id: pyver_short
run: |
echo "PYVER_SHORT=$(echo ${{ matrix.pyver }} | cut -d'.' -f1,2)" >> $GITHUB_OUTPUT
- name: Build and push base image
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.base
push: true
build-args: |
PYTHON_VERSION=${{ matrix.pyver }}
tags: |
ghcr.io/${{ steps.repo.outputs.REPO }}-base:${{ steps.pyver_short.outputs.PYVER_SHORT }}-latest