Skip to content

Build Debian images for PDNS CI #8

Build Debian images for PDNS CI

Build Debian images for PDNS CI #8

name: Build Debian images for PDNS CI
on:
workflow_dispatch:
push:
pull_request:
schedule:
- cron: '0 23 * * *'
env:
IMAGE_TAG: master
jobs:
build-and-push-debian-images:
strategy:
matrix:
include:
- image-id: debian-11-pdns-base
debian-release-name: bullseye-slim
- image-id: debian-12-pdns-base
debian-release-name: bookworm-slim
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- run: |
echo "image-id-lowercase=ghcr.io/${{ github.repository }}/${{ matrix.image-id }}" | tr '[:upper:]' '[:lower:]' >> "$GITHUB_ENV"
- name: Build image
run: |
docker build . --file Dockerfile \
--tag ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }} \
--build-arg DEBIAN_IMAGE_TAG=${{ matrix.debian-release-name }}
- name: Login to GitHub Container Registry
if: ${{ github.event_name != 'pull_request' }}
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push into Github Container Registry
if: ${{ github.event_name != 'pull_request' }}
run: |
docker push ${{ env.image-id-lowercase }}:${{ env.IMAGE_TAG }}