Skip to content

Commit

Permalink
Merge pull request DSpace#10070 from tdonohue/fixup_docker_builds
Browse files Browse the repository at this point in the history
[GitHub Actions]  Ensure our Docker build process authenticates in an early step, so nothing is unauthenticated
  • Loading branch information
tdonohue authored Dec 3, 2024
2 parents 7542889 + b83bac0 commit b88b237
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/reusable-docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,29 +105,29 @@ jobs:
- name: Checkout codebase
uses: actions/checkout@v4

# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/docker/login-action
- name: Login to DockerHub
# Only login if not a PR, as PRs only trigger a Docker build and not a push
if: ${{ ! matrix.isPr }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU emulation to build for multiple architectures
uses: docker/setup-qemu-action@v3

# https://github.com/docker/setup-buildx-action
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3

#------------------------------------------------------------
# Build & deploy steps for new commits to a branch (non-PRs)
#
# These steps build the images, push to DockerHub, and
# (if necessary) redeploy demo/sandbox sites.
#------------------------------------------------------------
# https://github.com/docker/login-action
- name: Login to DockerHub
# Only login if not a PR, as PRs only trigger a Docker build and not a push
if: ${{ ! matrix.isPr }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

# https://github.com/docker/metadata-action
# Get Metadata for docker_build_deps step below
- name: Sync metadata (tags, labels) from GitHub to Docker for image
Expand Down Expand Up @@ -257,6 +257,12 @@ jobs:
pattern: digests-${{ inputs.build_id }}-*
merge-multiple: true

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

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -268,12 +274,6 @@ jobs:
tags: ${{ env.IMAGE_TAGS }}
flavor: ${{ env.TAGS_FLAVOR }}

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

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

0 comments on commit b88b237

Please sign in to comment.