2022-12-09 21:58:40 +00:00
|
|
|
name: 'Docker Image'
|
2022-12-09 20:58:55 +00:00
|
|
|
|
2021-10-31 13:23:49 +00:00
|
|
|
on:
|
2022-12-09 17:30:18 +00:00
|
|
|
workflow_dispatch:
|
2021-10-31 13:23:49 +00:00
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
tags:
|
|
|
|
- 'v*.*.*'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build-and-push-docker-image:
|
2022-12-09 22:02:36 +00:00
|
|
|
name: Build Docker Image
|
2021-10-31 13:23:49 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
|
|
|
|
steps:
|
2022-12-09 16:41:38 +00:00
|
|
|
- name: Repository Checkout
|
2021-10-31 13:23:49 +00:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2022-12-09 16:41:38 +00:00
|
|
|
- name: Docker Image Metadata
|
2021-10-31 13:23:49 +00:00
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v3
|
|
|
|
with:
|
|
|
|
images: |
|
2022-12-09 16:41:38 +00:00
|
|
|
powerdnsadmin/pda-legacy
|
2021-10-31 13:23:49 +00:00
|
|
|
tags: |
|
2021-11-06 14:37:13 +00:00
|
|
|
type=ref,event=tag
|
2021-10-31 13:23:49 +00:00
|
|
|
type=semver,pattern={{version}}
|
|
|
|
type=semver,pattern={{major}}.{{minor}}
|
|
|
|
type=semver,pattern={{major}}
|
|
|
|
|
2022-12-09 16:41:38 +00:00
|
|
|
- name: Docker Buildx Setup
|
2021-10-31 13:23:49 +00:00
|
|
|
id: buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
|
2022-12-09 16:41:38 +00:00
|
|
|
- name: Docker Hub Authentication
|
2021-10-31 13:23:49 +00:00
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
2022-12-09 16:41:38 +00:00
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME_V2 }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN_V2 }}
|
2021-10-31 13:23:49 +00:00
|
|
|
|
2022-12-09 16:41:38 +00:00
|
|
|
- name: Docker Image Build
|
2021-10-31 13:23:49 +00:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
if: github.ref == 'refs/heads/master'
|
|
|
|
with:
|
2021-10-31 13:34:35 +00:00
|
|
|
context: ./
|
|
|
|
file: ./docker/Dockerfile
|
2021-10-31 13:23:49 +00:00
|
|
|
push: true
|
2022-12-09 16:41:38 +00:00
|
|
|
tags: powerdnsadmin/pda-legacy:latest
|
2021-10-31 13:23:49 +00:00
|
|
|
|
2022-12-09 16:41:38 +00:00
|
|
|
- name: Docker Image Release Tagging
|
2021-10-31 13:23:49 +00:00
|
|
|
uses: docker/build-push-action@v2
|
2021-11-06 14:44:20 +00:00
|
|
|
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
|
2021-10-31 13:23:49 +00:00
|
|
|
with:
|
2021-10-31 13:34:35 +00:00
|
|
|
context: ./
|
|
|
|
file: ./docker/Dockerfile
|
2021-11-06 14:44:20 +00:00
|
|
|
push: true
|
2021-10-31 13:23:49 +00:00
|
|
|
tags: ${{ steps.meta.outputs.tags }}
|
2021-11-06 14:37:13 +00:00
|
|
|
labels: ${{ steps.meta.outputs.labels }}
|