Update base images #5
Workflow file for this run
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: Docker Image CI pdns-admin | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to build, matching pdns-admin-*. Leave empty to use the latest matching tag." | |
| required: false | |
| type: string | |
| push: | |
| tags: | |
| - 'pdns-admin-*' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check Out Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| id: buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v4 | |
| with: | |
| username: ${{ secrets.DOCKER_HUB_USERNAME }} | |
| password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | |
| - name: Set output | |
| id: vars | |
| env: | |
| EVENT_NAME: ${{ github.event_name }} | |
| REF_NAME: ${{ github.ref_name }} | |
| SELECTED_TAG: ${{ inputs.tag }} | |
| TAG_FILTER: pdns-admin-* | |
| run: | | |
| set -euo pipefail | |
| tag="$SELECTED_TAG" | |
| if [ -z "$tag" ]; then | |
| if [ "$EVENT_NAME" = "push" ]; then | |
| tag="$REF_NAME" | |
| else | |
| tag="$(git tag --list "$TAG_FILTER" --sort=-v:refname | head -n 1)" | |
| fi | |
| fi | |
| if [ -z "$tag" ]; then | |
| echo "No tag found matching $TAG_FILTER" | |
| exit 1 | |
| fi | |
| case "$tag" in | |
| pdns-admin-*) ;; | |
| *) | |
| echo "Tag '$tag' does not match $TAG_FILTER" | |
| exit 1 | |
| ;; | |
| esac | |
| echo "tag=$tag" >> "$GITHUB_OUTPUT" | |
| echo "version=${tag##*-}" >> "$GITHUB_OUTPUT" | |
| - name: Check out selected tag | |
| env: | |
| TAG: ${{ steps.vars.outputs.tag }} | |
| run: git checkout --detach "refs/tags/$TAG" | |
| - name: Build and push PDNS Admin | |
| id: docker_build_pdns_admin | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ./pdns-admin | |
| file: ./pdns-admin/Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| builder: ${{ steps.buildx.outputs.name }} | |
| push: true | |
| tags: ${{ secrets.DOCKER_HUB_USERNAME }}/pdns-admin:${{ steps.vars.outputs.version }} | |
| - name: Image digest | |
| run: echo ${{ steps.docker_build_pdns_admin.outputs.digest }} |