Skip to content

Base-Numpy

Base-Numpy #10

Workflow file for this run

name: Base-Numpy
on:
push:
branches: ["main"]
paths:
- "base/numpy/**"
schedule:
- cron: "0 0 * * 1"
workflow_dispatch:
env:
REGISTRY: ghcr.io
REPOSITORY: challenge-base
NAME: numpy
jobs:
build-numpy:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Docker setup QEMU
uses: docker/setup-qemu-action@v3
- name: Docker setup 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: |
latest
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: base/${{ env.NAME }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
push: true
prune-numpy:
runs-on: ubuntu-latest
needs: build-numpy
permissions:
contents: read
packages: write
steps:
- name: Prune old packages
uses: dataaxiom/ghcr-cleanup-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
package: ${{ env.REPOSITORY }}/${{ env.NAME }}
validate: true
dry-run: false
delete-untagged: true
delete-ghost-images: true
delete-partial-images: true