Skip to content

Bump actions/checkout from 5 to 6 (#7) #73

Bump actions/checkout from 5 to 6 (#7)

Bump actions/checkout from 5 to 6 (#7) #73

Workflow file for this run

name: Docker Build Image from Repository
on:
schedule:
- cron: "0 0 * * 0"
push:
branches:
- "*"
tags:
- "v*.*.*"
pull_request:
branches:
- "*"
workflow_dispatch:
env:
REGISTRY1: ghcr.io
REGISTRY2: docker.io
IMAGE_NAME1: ${{ github.repository }}
IMAGE_NAME2: ${{ vars.DOCKERHUB_REPO }}
jobs:
cleanup-untagged-images:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Delete all containers from package without tags
uses: actions/delete-package-versions@v5
with:
package-name: ${{ vars.IMAGE_NAME }}
package-type: container
min-versions-to-keep: 20
delete-only-untagged-versions: true
build-packages:
if: ${{ github.event_name != 'pull_request' }}
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup QEMU
uses: docker/setup-qemu-action@v3
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY1 }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get & Set Container Metadata
id: meta-packages
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY1 }}/${{ env.IMAGE_NAME1 }}
- name: Build & Push
id: build-and-push-packages
uses: docker/build-push-action@v6
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-packages.outputs.tags }}
labels: ${{ steps.meta-packages.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max
- name: Build & Push OCI
id: build-and-push-packages-oci
uses: docker/build-push-action@v6
with:
context: ./oci
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta-packages.outputs.tags }}-oci
labels: ${{ steps.meta-packages.outputs.labels }}
cache-from: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache
cache-to: type=registry,ref=ghcr.io/${{ github.repository }}:buildcache,mode=max