Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Actions: Use shared action to login to DockerHub #991

Merged
merged 1 commit into from
Jan 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading