Skip to content

Build and Push DNS Image #3

Build and Push DNS Image

Build and Push DNS Image #3

name: Build and Push DNS Image
on:
push:
branches: [main]
paths:
- 'containerfiles/dns/**'
pull_request:
paths:
- 'containerfiles/dns/**'
workflow_dispatch:
inputs:
push:
description: 'Push image to registry'
required: false
default: 'false'
type: boolean
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}/dns
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Log in to GHCR
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push)
run: podman login -u ${{ github.actor }} -p ${{ secrets.GITHUB_TOKEN }} ${{ env.REGISTRY }}
- name: Build DNS image
run: make build-dns-image
- name: Push
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.push)
run: podman push ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest