Skip to content

Commit

Permalink
Manual Release for Nginxinc (#57)
Browse files Browse the repository at this point in the history
* move to buildx actions

* move to buildx actions

* formatting

* Refactor and use github actions build

* format

* Skip push if running in ACT

---------

Co-authored-by: Jeremy <[email protected]>
  • Loading branch information
jeremy-cxf and Jeremy authored Jun 22, 2023
1 parent 9938455 commit 37fd77c
Showing 1 changed file with 34 additions and 9 deletions.
43 changes: 34 additions & 9 deletions .github/workflows/manual-nginxinc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,44 @@ name: Manual Push NginxInc Image to DockerHub
on:
workflow_dispatch:

env:
DOCKERHUB_IMAGE: signalsciences/sigsci-nginxinc-ingress-controller
DISTRIBUTION: alpine
UPSTREAM_NGINX_INGRESS_VERSION: 2.3.0

jobs:
deploy:
buildpush_to_dockerhub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_API_TOKEN }}
- name: Build and Push image to docker Hub
env:
TAG: 2.3.0
REPO: signalsciences/sigsci-nginxinc-ingress-controller
run: |
docker buildx build . --file Dockerfile.nginxinc --build-arg NGINX_INGRESS_VERSION=${TAG} --tag ${REPO}:${TAG} --tag ${REPO}:latest --push .

- name: Build and push
uses: docker/build-push-action@v4
with:
cache-from: type=gha
cache-to: type=gha,mode=max
context: .
file: Dockerfile.nginxinc
build-args: |
NGINX_INGRESS_VERSION=${{ env.UPSTREAM_NGINX_INGRESS_VERSION }}
CONTAINER_BASE=${{ env.DISTRIBUTION }}
push: ${{ !env.ACT }}
tags: >-
${{ env.DOCKERHUB_IMAGE }}:${{ env.UPSTREAM_NGINX_INGRESS_VERSION }},${{ env.DOCKERHUB_IMAGE}}:latest,
- name: Echo output
run: >-
echo "::set-output
name=image::${{ env.DOCKERHUB_IMAGE}}:latest,${{ env.DOCKERHUB_IMAGE }}:${{ env.UPSTREAM_NGINX_INGRESS_VERSION }}"

0 comments on commit 37fd77c

Please sign in to comment.