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

feat: Add Docker Hub login and push within Docker build actions #1951

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
28 changes: 14 additions & 14 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,18 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKER_HUB_USER }}
password: ${{ secrets.REGISTRY_PASS }}

- name: Build and push Docker image for Dockerfile
uses: docker/build-push-action@v5
with:
context: .
target: scratch
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUDB }}:dev
file: build/Dockerfile
Expand All @@ -252,6 +259,7 @@ jobs:
with:
context: .
target: ${{ env.DEBIAN_VERSION }}
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUDB }}:dev-${ env.DEBIAN_VERSION }
file: build/Dockerfile
Expand All @@ -260,6 +268,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUDB }}:dev-${ env.ALMA_VERSION }
file: build/Dockerfile.alma
Expand All @@ -268,6 +277,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUADMIN }}:dev
file: build/Dockerfile.immuadmin
Expand All @@ -276,6 +286,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUCLIENT }}:dev
file: build/Dockerfile.immuclient
Expand All @@ -284,6 +295,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUDB_FIPS }}:dev
file: build/fips/Dockerfile
Expand All @@ -292,6 +304,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUADMIN_FIPS }}:dev
file: build/fips/Dockerfile.immuadmin
Expand All @@ -300,6 +313,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
push: true
tags: |
${{ env.DOCKER_IMAGE_IMMUCLIENT_FIPS }}:dev
file: build/fips/Dockerfile.immuclient
Expand All @@ -312,17 +326,6 @@ jobs:
VERSION_TAG_SHORT="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}"
fi

docker login -u "${{ secrets.REGISTRY_USER }}" -p "${{ secrets.REGISTRY_PASS }}"

docker push "${DOCKER_IMAGE_IMMUDB}:dev"
docker push "${DOCKER_IMAGE_IMMUDB}:dev-${DEBIAN_VERSION}"
docker push "${DOCKER_IMAGE_IMMUDB}:dev-${ALMA_VERSION}"
docker push "${DOCKER_IMAGE_IMMUADMIN}:dev"
docker push "${DOCKER_IMAGE_IMMUCLIENT}:dev"
docker push "${DOCKER_IMAGE_IMMUDB_FIPS}:dev"
docker push "${DOCKER_IMAGE_IMMUADMIN_FIPS}:dev"
docker push "${DOCKER_IMAGE_IMMUCLIENT_FIPS}:dev"

if [[ ! -z "$VERSION_TAG" ]]; then
for tag in "${VERSION_TAG}" "${VERSION_TAG_SHORT}" "latest"; do
docker tag "${DOCKER_IMAGE_IMMUDB}:dev" "${DOCKER_IMAGE_IMMUDB}:${tag}"
Expand Down Expand Up @@ -352,9 +355,6 @@ jobs:
done
fi

docker logout


coveralls:
name: Publish coverage
needs:
Expand Down
Loading