Skip to content

Commit

Permalink
Login to docker hub early to reduce rate limiting
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 4d8c381 commit 90a3129
Showing 1 changed file with 17 additions and 29 deletions.
46 changes: 17 additions & 29 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,43 @@
name: push

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

jobs:
docker:
if: github.repository_owner == 'keikoproj'
runs-on: ubuntu-latest
steps:
-
name: Check out code
- name: Check out code
uses: actions/checkout@v4

-
name: Set up Docker Buildx
# Authenticate to DockerHub first to reduce rate limiting
- 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: 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: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v3

-
name: Docker metadata
- 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
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
Expand Down

0 comments on commit 90a3129

Please sign in to comment.