fix: push docker images by their name instead of the ids

This commit is contained in:
nugaon 2021-05-04 16:08:19 +02:00
parent 870dc2da1e
commit ccc3b5eca6
2 changed files with 7 additions and 7 deletions

View File

@ -8,8 +8,8 @@ on:
description: 'The image tag will be retrieved from the bee version command'
default: 'false'
beeVersion:
description: 'The official bee image tag that the image will be built on'
default: 'latest'
description: 'The official bee image tag that the image will be built on. Default: last supported version'
default: '0.5.3'
push:
branches:
- 'master'
@ -19,6 +19,8 @@ on:
env:
BEE_IMAGE_PREFIX: 'docker.pkg.github.com/ethersphere/bee-factory'
COMMIT_VERSION_TAG: ${{ github.event.inputs.commitVersionTag }}
BEE_VERSION: ${{ github.event.inputs.beeVersion }}
jobs:
bee-images:
@ -34,7 +36,7 @@ jobs:
with:
fetch-depth: 1
- name: Auth to Github Package Docker Registry
if: (github.ref == 'refs/heads/master' || ${{ github.event.inputs.buildImage == 'true' }}) && success()
if: ${{ github.event.inputs.buildImage == 'true' && success() }}
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login https://docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin
- name: Install npm deps
@ -44,8 +46,6 @@ jobs:
run: |
npm run build:env
- name: Publish if it was clicked manually
if: ${{ github.event.inputs.buildImage == 'true' }} && success()
if: ${{ github.event.inputs.buildImage == 'true' && success() }}
run: |
export COMMIT_VERSION_TAG="${{ github.event.inputs.commitVersionTag }}"
export BEE_VERSION="${{ github.event.inputs.beeVersion }}"
npm run publish:env

View File

@ -6,7 +6,7 @@ BEE_IMAGE_PREFIX=$("$MY_PATH/utils/env-variable-value.sh" BEE_IMAGE_PREFIX)
BEE_ENV_PREFIX=$("$MY_PATH/utils/env-variable-value.sh" BEE_ENV_PREFIX)
BEE_VERSION=$("$MY_PATH/utils/env-variable-value.sh" BEE_VERSION)
echo "Search Docker built images with the following parameters: $BEE_IMAGE_PREFIX/$BEE_ENV_PREFIX*:$BEE_VERSION"
DOCKER_IMAGES=$(docker image ls -qaf reference="$BEE_IMAGE_PREFIX/$BEE_ENV_PREFIX*:$BEE_VERSION")
DOCKER_IMAGES=$(docker image ls --format "{{.Repository}}" -af reference="$BEE_IMAGE_PREFIX/$BEE_ENV_PREFIX*:$BEE_VERSION")
echo "Push docker images: $DOCKER_IMAGES"
for DOCKER_IMAGE in $DOCKER_IMAGES
do