diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml index 79a47cb48..34c072198 100644 --- a/.github/workflows/cd.yaml +++ b/.github/workflows/cd.yaml @@ -57,7 +57,7 @@ jobs: # Run the deploy script for each service - name: Deploy api microservice container to GHCR run: | - ./assets/scripts/push_image.sh compose_api ${{ env.API_VERSION }} ${{ secrets.REPO_ADMIN_GH_USERNAME }} + ./assets/scripts/push_image.sh compose_api ${{ env.API_VERSION }} env: REPO_ADMIN_GH_USERNAME: ${{ secrets.REPO_ADMIN_GH_USERNAME }} REPO_ADMIN_GHCR_TOKEN: ${{ secrets.REPO_ADMIN_GHCR_TOKEN }} @@ -65,7 +65,7 @@ jobs: # Run the deploy script for each service - name: Deploy worker microservice container to GHCR run: | - ./assets/scripts/push_image.sh compose_worker ${{ env.WORKER_VERSION }} ${{ secrets.REPO_ADMIN_GH_USERNAME }} + ./assets/scripts/push_image.sh compose_worker ${{ env.WORKER_VERSION }} env: REPO_ADMIN_GH_USERNAME: ${{ secrets.REPO_ADMIN_GH_USERNAME }} REPO_ADMIN_GHCR_TOKEN: ${{ secrets.REPO_ADMIN_GHCR_TOKEN }} diff --git a/assets/scripts/push_image.sh b/assets/scripts/push_image.sh index bd029330c..72a5306ed 100755 --- a/assets/scripts/push_image.sh +++ b/assets/scripts/push_image.sh @@ -4,7 +4,7 @@ set -e lib="$1" version="$2" -# gh_username="$3" +gh_username="$3" if [ "$version" == "" ]; then echo "You must pass a version as second arg." @@ -12,7 +12,9 @@ if [ "$version" == "" ]; then fi # login to github -# ./assets/scripts/gh_login.sh "$gh_username" +if [ "$gh_username" != "" ]; then + ./assets/scripts/gh_login.sh "$gh_username" +fi # yes | docker system prune