Skip to content

Commit fbe4693

Browse files
committed
coredns(plugin+ci): Add build image job for coredns plugin
Adds a anew buid images github action for the kuadrant CoreDNS plugin. Add coredns_plugin to branches (DO NOT MERGE) Signed-off-by: Michael Nairn <[email protected]> ci fix Signed-off-by: Michael Nairn <[email protected]>
1 parent fee5e6a commit fbe4693

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Build and Publish CoreDNS Images
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- coredns_plugin
8+
- "release-*"
9+
workflow_dispatch:
10+
11+
env:
12+
IMG_TAGS: ${{ github.sha }} ${{ github.ref_name }}
13+
IMG_REGISTRY_HOST: quay.io
14+
IMG_REGISTRY_ORG: kuadrant
15+
IMG_REGISTRY_REPO: coredns-kuadrant
16+
MAIN_BRANCH_NAME: main
17+
COREDNS_PLUGIN_NAME: coredns-kuadrant
18+
19+
jobs:
20+
build:
21+
name: Build and Push CoreDNS image
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Check out code
25+
uses: actions/checkout@v4
26+
27+
- name: Add latest tag
28+
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
29+
id: add-latest-tag
30+
run: |
31+
echo "IMG_TAGS=latest ${{ env.IMG_TAGS }}" >> $GITHUB_ENV
32+
33+
- name: Install qemu dependency
34+
run: |
35+
sudo apt-get update
36+
sudo apt-get install -y qemu-user-static
37+
38+
- name: Build Image
39+
id: build-image
40+
uses: redhat-actions/buildah-build@v2
41+
with:
42+
image: ${{ env.COREDNS_PLUGIN_NAME }}
43+
tags: ${{ env.IMG_TAGS }}
44+
platforms: linux/amd64,linux/arm64
45+
context: ./coredns/plugin
46+
dockerfiles: |
47+
./coredns/plugin/Dockerfile
48+
49+
- name: Print Build Info
50+
run: echo "Image = ${{ steps.build-image.outputs.image }}, Tags = ${{ steps.build-image.outputs.tags }}"
51+
52+
- name: Push Image
53+
if: github.repository_owner == 'kuadrant'
54+
id: push-to-quay
55+
uses: redhat-actions/push-to-registry@v2
56+
with:
57+
image: ${{ steps.build-image.outputs.image }}
58+
tags: ${{ steps.build-image.outputs.tags }}
59+
registry: ${{ env.IMG_REGISTRY_HOST }}/${{ env.IMG_REGISTRY_ORG }}
60+
username: ${{ secrets.IMG_REGISTRY_USERNAME }}
61+
password: ${{ secrets.IMG_REGISTRY_TOKEN }}
62+
63+
- name: Print Image URL
64+
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"

0 commit comments

Comments
 (0)