Introduce nano-nightly dockerhub registry for live network builds (#4513)

* simplify DOCKER_PASSWORD conditional check

* move env variable declaration to job level

* feat: introduce nano-nightly dockerhub registry for live network

- all non release builds for the live network are pushed to nano-nightly
- only release builds will be pushed to nanocurrency/nano dockerhub registry

* avoid setting `docker_image_name` twice

---------

Co-authored-by: gr0vity-dev <homebot@users.noreply.github.com>
This commit is contained in:
gr0vity-dev 2024-03-22 10:28:00 +01:00 committed by GitHub
commit 9c72bebfb1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 10 deletions

View file

@ -155,6 +155,12 @@ jobs:
strategy:
matrix:
network: ["TEST", "BETA", "LIVE"]
env:
CI_TAG: ${{ needs.prepare_build.outputs.ci_tag }}
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
DOCKER_USER: ${{ vars.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
IS_RELEASE_BUILD: ${{ github.event.inputs.is_release_build || 'false' }}
steps:
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 #v3.1.0
with:
@ -165,23 +171,15 @@ jobs:
run: ci/actions/linux/docker-build.sh
env:
NETWORK: ${{ matrix.network }}
CI_TAG: ${{ needs.prepare_build.outputs.ci_tag }}
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
- name: Check if secrets.DOCKER_PASSWORD exists
run: echo "DOCKER_PASSWORD_EXISTS=${{ secrets.DOCKER_PASSWORD != '' }}" >> $GITHUB_ENV
- name: Deploy Docker Hub
if: env.DOCKER_PASSWORD_EXISTS == 'true'
if: env.DOCKER_PASSWORD != ''
run: ci/actions/linux/docker-deploy.sh
env:
CI_TAG: ${{ needs.prepare_build.outputs.ci_tag }}
NETWORK: ${{ matrix.network }}
DOCKER_REGISTRY: ${{ vars.DOCKER_REGISTRY }}
DOCKER_USER: ${{ vars.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Deploy Docker (ghcr.io)
run: ci/actions/linux/ghcr-deploy.sh
env:
CI_TAG: ${{ needs.prepare_build.outputs.ci_tag }}
NETWORK: ${{ matrix.network }}
DOCKER_REGISTRY: ghcr.io
DOCKER_USER: ${{ github.repository_owner }}

View file

@ -18,7 +18,11 @@ fi
if [[ "$NETWORK" = "LIVE" ]]; then
echo "Live"
network_tag_suffix=''
if [[ "$IS_RELEASE_BUILD" = "true" ]]; then
network_tag_suffix=''
else
network_tag_suffix='-nightly'
fi
network="live"
elif [[ "$NETWORK" = "BETA" ]]; then
echo "Beta"