Add github actions for docker release. (#5146)

* Add github actions for docker release.

Once a release/tag shown up in GitHub,
an GitHub Action will be automatically triggered
for docker release.

This will help avoid additional steps when releasing.

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Update to address the review

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>

* Address review comment

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2022-02-03 10:23:39 -08:00
committed by GitHub
parent 7d9ad0872c
commit 8509fb569d

26
.github/workflows/docker.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Docker Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
release:
description: "Release (e.g., v1.9.0)"
required: true
jobs:
docker-release:
runs-on: ubuntu-latest
env:
DOCKER_LOGIN: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
RELEASE: ${{ github.event.inputs.release || github.event.release.tag_name }}
steps:
- uses: actions/checkout@v2
- name: Build Docker Images
run: make VERSION=${RELEASE:1} DOCKER=coredns -f Makefile.docker release
- name: Show Docker Images
run: docker images
- name: Publish Docker Images
run: make VERSION=${RELEASE:1} DOCKER=coredns -f Makefile.docker docker-push