mirror of
https://github.com/cwinfo/powerdns-admin.git
synced 2024-11-08 22:50:26 +00:00
c49df09ac8
Signed-off-by: Khanh Ngo <khanh.ngo@taxfix.de>
56 lines
1.4 KiB
YAML
56 lines
1.4 KiB
YAML
on:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
tags:
|
|
- 'v*.*.*'
|
|
|
|
jobs:
|
|
build-and-push-docker-image:
|
|
name: Build Docker image and push to repositories
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Docker meta
|
|
id: meta
|
|
uses: docker/metadata-action@v3
|
|
with:
|
|
images: |
|
|
ngoduykhanh/powerdns-admin
|
|
tags: |
|
|
type=semver,pattern={{version}}
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
type=semver,pattern={{major}}
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to DockerHub
|
|
uses: docker/login-action@v1
|
|
with:
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
- name: Build latest image
|
|
uses: docker/build-push-action@v2
|
|
if: github.ref == 'refs/heads/master'
|
|
with:
|
|
context: ./docker
|
|
push: true
|
|
tags: ngoduykhanh/powerdns-admin:latest
|
|
|
|
- name: Build release image
|
|
uses: docker/build-push-action@v2
|
|
if: ${{ github.event_name == 'create' && github.event.ref_type == 'tag' }}
|
|
with:
|
|
context: ./docker
|
|
push: true
|
|
tags: ${{ steps.meta.outputs.tags }}
|