Skip to content

Commit 8d823fc

Browse files
committed
Update the github workflow logic to do dockerhub login later
Signed-off-by: Min Yeol Lim <min.yeol.lim@intel.com>
1 parent 6803335 commit 8d823fc

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/build-test-deploy.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -383,27 +383,34 @@ jobs:
383383
name: gprofiler_aarch64
384384
path: output/
385385

386-
- name: Login to DockerHub
387-
uses: docker/login-action@v1
388-
with:
389-
username: ${{ secrets.DOCKERHUB_USERNAME }}
390-
password: ${{ secrets.DOCKERHUB_TOKEN }}
391-
392-
- name: Build and push
386+
- name: Build
393387
run: |
394388
set -x
395389
396390
BASE_IMAGE="${{ env.GH_REPO }}:${{ env.RELEASE_VERSION }}"
397391
AARCH64_IMAGE="$BASE_IMAGE-aarch64"
398392
REPO_LOWER=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]')
399393
400-
# build & push Aarch64
394+
# build Aarch64 (no push yet, to avoid Docker Hub token scope issues)
401395
# --skip-exe-build needs to be first!
402-
./scripts/build_aarch64_container.sh --skip-exe-build --provenance=false --build-arg EXE_PATH=output/gprofiler_aarch64 -t "$AARCH64_IMAGE" --push \
396+
./scripts/build_aarch64_container.sh --skip-exe-build --provenance=false --build-arg EXE_PATH=output/gprofiler_aarch64 -t "$AARCH64_IMAGE" --load \
403397
--cache-from type=gha \
404398
--cache-to type=gha,mode=max \
405399
--cache-from type=registry,ref=ghcr.io/${REPO_LOWER}/gprofiler-python-base:latest
406400
401+
- name: Login to DockerHub
402+
uses: docker/login-action@v1
403+
with:
404+
username: ${{ secrets.DOCKERHUB_USERNAME }}
405+
password: ${{ secrets.DOCKERHUB_TOKEN }}
406+
407+
- name: Push
408+
run: |
409+
set -x
410+
BASE_IMAGE="${{ env.GH_REPO }}:${{ env.RELEASE_VERSION }}"
411+
AARCH64_IMAGE="$BASE_IMAGE-aarch64"
412+
docker push "$AARCH64_IMAGE"
413+
407414
deploy-container:
408415
if: startsWith(github.ref, 'refs/tags/')
409416
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)