Skip to content

Dockerize the test environment for better reproducibility #8

Dockerize the test environment for better reproducibility

Dockerize the test environment for better reproducibility #8

name: Build and Push Base Docker Image
on:
push:
branches: [main, master, develop]
paths:
- 'Dockerfile.base'
- '.github/workflows/build_base_image.yml'
pull_request:
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
if: github.event_name != 'pull_request'
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 (on push)
if: github.event_name != 'pull_request'
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
- name: Build base image (on PR)
if: github.event_name == 'pull_request'
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile.base
push: false
build-args: |
PYTHON_VERSION=${{ matrix.pyver }}
tags: |
ghcr.io/${{ steps.repo.outputs.REPO }}-base:${{ steps.pyver_short.outputs.PYVER_SHORT }}-pr-test
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy