powerdns-admin/.github/workflows/build-and-publish.yml

81 lines
1.9 KiB
YAML
Raw Permalink Normal View History

---
name: 'Docker Image'
on:
workflow_dispatch:
push:
branches:
- 'dev'
- 'master'
tags:
- 'v*.*.*'
paths-ignore:
- .github/**
- deploy/**
- docker-test/**
- docs/**
- .dockerignore
- .gitattributes
- .gitignore
- .lgtm.yml
- .whitesource
- .yarnrc
- docker-compose.yml
- docker-compose-test.yml
- LICENSE
- README.md
- SECURITY.md
jobs:
build-and-push-docker-image:
name: Build Docker Image
runs-on: ubuntu-latest
steps:
- name: Repository Checkout
uses: actions/checkout@v2
- name: Docker Image Metadata
id: meta
uses: docker/metadata-action@v3
with:
images: |
powerdnsadmin/pda-legacy
tags: |
2021-11-06 14:37:13 +00:00
type=ref,event=tag
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: QEMU Setup
uses: docker/setup-qemu-action@v2
- name: Docker Buildx Setup
id: buildx
uses: docker/setup-buildx-action@v1
- name: Docker Hub Authentication
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME_V2 }}
password: ${{ secrets.DOCKERHUB_TOKEN_V2 }}
- name: Docker Image Build
uses: docker/build-push-action@v4
with:
platforms: linux/amd64,linux/arm64
context: ./
file: ./docker/Dockerfile
push: true
tags: powerdnsadmin/pda-legacy:${{ github.ref_name }}
- name: Docker Image Release Tagging
uses: docker/build-push-action@v2
2021-11-06 14:44:20 +00:00
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
context: ./
file: ./docker/Dockerfile
2021-11-06 14:44:20 +00:00
push: true
tags: ${{ steps.meta.outputs.tags }}
2021-11-06 14:37:13 +00:00
labels: ${{ steps.meta.outputs.labels }}