Skip to content

Commit

Permalink
Updates to docker push action
Browse files Browse the repository at this point in the history
Signed-off-by: Todd Ekenstam <Todd_Ekenstam@intuit.com>
  • Loading branch information
tekenstam committed Sep 28, 2023
1 parent fc2a192 commit 446eece
Showing 1 changed file with 50 additions and 45 deletions.
95 changes: 50 additions & 45 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,54 +2,59 @@ name: push

on:
push:
branches: [ master ]
branches:
- 'master'
tags:
- '*'
- 'v*'

jobs:
push:
name: push
docker:
if: github.repository_owner == 'keikoproj'
runs-on: ubuntu-latest
steps:

- name: Check out code into the Go module directory
uses: actions/checkout@v4

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
install: true
version: latest

- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3
with:
platforms: linux/amd64,linux/arm64

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/cluster-validator
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
-
name: Check out code
uses: actions/checkout@v4

-
name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3

-
name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
with:
install: true
version: latest

-
name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ github.repository_owner }}/cluster-validator
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

-
name: Build and push
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

0 comments on commit 446eece

Please sign in to comment.