Skip to content

Docker build ingress-nginx-controller-dynamic-modules image #7684

Docker build ingress-nginx-controller-dynamic-modules image

Docker build ingress-nginx-controller-dynamic-modules image #7684

name: Docker build ingress-nginx-controller-dynamic-modules image
on:
workflow_dispatch:
schedule:
- cron: "0 * * * *"
push:
paths:
- '.github/workflows/docker-build-ingress-nginx-controller-dynamic-modules.yml'
- 'ingress-nginx-controller-dynamic-modules/**'
jobs:
build:
runs-on: 'ubuntu-latest'
steps:
- name: Get latest tag
id: get-latest-tag
run: |
echo "tag=$(git ls-remote --refs --tags https://github.com/kubernetes/ingress-nginx |grep refs/tags/controller | tail -1 | awk '{print $2;}' | sed 's/refs\/tags\/controller-//')" >> $GITHUB_ENV
shell: bash
- uses: actions/cache@v2
id: cache
with:
path: ingress-nginx-controller-dynamic-modules
key: ${{ runner.os }}-v4-${{ env.tag }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if: steps.cache.outputs.cache-hit != 'true'
with:
platforms: all
- name: Check Out Repo
uses: actions/checkout@v3
- name: Login to Quay.io
if: steps.cache.outputs.cache-hit != 'true'
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
- name: Set up Docker Buildx
if: steps.cache.outputs.cache-hit != 'true'
id: buildx
uses: docker/setup-buildx-action@v2
with:
version: latest
- name: Set up build timestamp
if: steps.cache.outputs.cache-hit != 'true'
run: echo "timestamp=$(date +%Y%m%d)" >> $GITHUB_ENV
- name: Build and push docker image
if: steps.cache.outputs.cache-hit != 'true'
id: docker_build_new
uses: docker/build-push-action@v3
with:
context: ./ingress-nginx-controller-dynamic-modules
file: ./ingress-nginx-controller-dynamic-modules/Dockerfile
platforms: linux/amd64,linux/arm64/v8
push: true
tags: quay.io/unixfox/ingress-nginx-controller-dynamic-modules:latest, quay.io/unixfox/ingress-nginx-controller-dynamic-modules:${{ env.tag }}, quay.io/unixfox/ingress-nginx-controller-dynamic-modules:${{ env.tag }}-build-${{ env.timestamp }}
build-args: INGRESS_NGINX_CONTROLLER_VERSION=${{ env.tag }}