Skip to content

Commit

Permalink
Github Actions: Use shared action to login to DockerHub (#991)
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduchesne authored Jan 30, 2024
1 parent d2637d2 commit 847408b
Showing 1 changed file with 4 additions and 28 deletions.
32 changes: 4 additions & 28 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,9 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

# Login to Docker Hub
- name: Get Secrets
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
# Secrets placed in the ci/common/<path> path in Vault
common_secrets: |
DOCKERHUB_USERNAME=dockerhub:username
DOCKERHUB_TOKEN=dockerhub:password
- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
uses: grafana/shared-workflows/actions/dockerhub-login@main

- name: Build and push by digest
id: build
Expand Down Expand Up @@ -127,19 +114,8 @@ jobs:
images: ${{ env.REGISTRY_IMAGE }}
tags: ${{ env.TAGS_CONFIG }}

# Login to Docker Hub
- name: Get Secrets
uses: grafana/shared-workflows/actions/get-vault-secrets@main
with:
# Secrets placed in the ci/common/<path> path in Vault
common_secrets: |
DOCKERHUB_USERNAME=dockerhub:username
DOCKERHUB_TOKEN=dockerhub:password
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ env.DOCKERHUB_USERNAME }}
password: ${{ env.DOCKERHUB_TOKEN }}
- name: Login to DockerHub
uses: grafana/shared-workflows/actions/dockerhub-login@main

- name: Create manifest list and push
working-directory: /tmp/digests
Expand Down

0 comments on commit 847408b

Please sign in to comment.