Skip to content

ci(publish): add steps for building with(out) cache #48

ci(publish): add steps for building with(out) cache

ci(publish): add steps for building with(out) cache #48

Workflow file for this run

name: publish-3.13
on:
push:
branches:
- 'coatl'
paths:
- '.github/workflows/publish.yml'
- '.github/workflows/publish-3.13.yml'
- '3.13/**'
schedule:
- cron: '0 9 * * 0,4'
- cron: '45 7 1 * *'
jobs:
tagger:
runs-on: ubuntu-latest
outputs:
major: ${{ steps.tags.outputs.major }}
major-minor: ${{ steps.tags.outputs.major-minor }}
version: ${{ steps.tags.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract version number
id: tags
run: |
# Extract the Python version from the Dockerfile
VERSION=$(grep 'ENV PYTHON_VERSION' 3.13/bookworm/Dockerfile | cut -d '=' -f 2)
echo "VERSION=${VERSION}"
# Trim the version to the first two segments (major.minor)
MAJOR_MINOR=$(echo $VERSION | cut -d'.' -f1-2)
echo "MAJOR_MINOR=${MAJOR_MINOR}"
# Trim the version to the first segment (major)
MAJOR=$(echo $VERSION | cut -d'.' -f1-1)
echo "MAJOR=${MAJOR}"
# Export the extracted version to GITHUB_OUTPUT
echo "major=${MAJOR}" >> $GITHUB_OUTPUT
echo "major-minor=${MAJOR_MINOR}" >> $GITHUB_OUTPUT
echo "version=${VERSION}" >> $GITHUB_OUTPUT
publish:
needs: tagger
uses: ./.github/workflows/publish.yml
strategy:
matrix:
image:
- version: '3.13'
variant: bookworm
tags: |
${{ needs.tagger.outputs.major }}
${{ needs.tagger.outputs.major-minor }}
${{ needs.tagger.outputs.version }}
- version: '3.13'
variant: slim-bookworm
tags: |
${{ needs.tagger.outputs.major }}-slim
${{ needs.tagger.outputs.major-minor }}-slim
${{ needs.tagger.outputs.version }}-slim
with:
image: coatldev/python
version: ${{ matrix.image.version }}
build-cache: ${{ github.event.schedule == '45 7 1 * *' && 'false' || 'true' }}
variant: ${{ matrix.image.variant }}
tags: ${{ matrix.image.tags }}
username: ${{ vars.DOCKERHUB_USERNAME }}
secrets:
password: ${{ secrets.DOCKERHUB_TOKEN }}