Build and Push DNS Image #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |