Skip to content

chore: update tier 1 packages #10

chore: update tier 1 packages

chore: update tier 1 packages #10

Workflow file for this run

name: Python
on:
push:
branches: ["main"]
paths:
- "base/python/**"
- "updates/tier1.md"
- ".github/workflows/base.python.yml"
workflow_dispatch:
env:
REGISTRY: ghcr.io
NAME: python
TAG: alpine
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}/${{ env.NAME }}
tags: |
${{ env.TAG }}
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: base/${{ env.NAME }}
file: base/${{ env.NAME }}/Dockerfile
platforms: linux/amd64,linux/arm64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push: true
cleanup-images:
runs-on: ubuntu-latest
needs: build-and-push-image
permissions:
contents: read
packages: write
concurrency:
group: cleanup-images-python
steps:
- name: Get lower case repository name
id: lower_repo
run: |
export REPO_NAME=${{ github.event.repository.name }}
echo "repo_name=${REPO_NAME@L}" >> $GITHUB_OUTPUT
- name: Prune old packages
uses: dataaxiom/ghcr-cleanup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package: ${{ steps.lower_repo.outputs.repo_name }}/${{ env.NAME }}
dry-run: false
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true