mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-23 09:08:26 +01:00
Pass git action secret tp push image function in build workflow
Signed-off-by: danfengliu <danfengl@vmware.com>
This commit is contained in:
parent
7c33ac9b77
commit
a576ee8694
2
.github/workflows/build-package.yml
vendored
2
.github/workflows/build-package.yml
vendored
@ -97,7 +97,7 @@ jobs:
|
||||
uploader harbor-offline-installer-latest.tgz.asc $harbor_target_bucket
|
||||
echo "BUILD_BUNDLE=$harbor_offline_build_bundle" >> $GITHUB_ENV
|
||||
|
||||
publishImage $target_branch $Harbor_Assets_Version
|
||||
publishImage $target_branch $Harbor_Assets_Version "${{ secrets.DOCKER_HUB_USERNAME }}" "${{ secrets.DOCKER_HUB_PASSWORD }}"
|
||||
|
||||
- name: Slack Notification
|
||||
uses: sonots/slack-notice-action@v3
|
||||
|
@ -21,7 +21,7 @@ function publishImage {
|
||||
fi
|
||||
# rename the images with tag "dev" and push to Docker Hub
|
||||
docker images
|
||||
docker login -u $DOCKER_HUB_USERNAME -p $DOCKER_HUB_PASSWORD
|
||||
docker login -u $3 -p $4
|
||||
docker images | grep goharbor | grep -v "\-base" | sed -n "s|\(goharbor/[-._a-z0-9]*\)\s*\(.*$2\).*|docker tag \1:\2 \1:$image_tag;docker push \1:$image_tag|p" | bash
|
||||
echo "Images are published successfully"
|
||||
docker images
|
||||
|
Loading…
Reference in New Issue
Block a user