From 478cc9e753a42494d261387b4c67e4a37a3cf4ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Szpiech?= Date: Thu, 28 Sep 2023 17:38:00 +0200 Subject: [PATCH] chore(ci): publish main image in dockerhub (#4930) --- .github/workflows/publish-dist.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-dist.yml b/.github/workflows/publish-dist.yml index 6f2e0f05d..f4ef0d7fc 100644 --- a/.github/workflows/publish-dist.yml +++ b/.github/workflows/publish-dist.yml @@ -30,12 +30,18 @@ jobs: echo IS_IPFS_RELEASE=false >> $GITHUB_ENV echo IS_S3_RELEASE=false >> $GITHUB_ENV echo IS_DEV_IMAGE=false >> $GITHUB_ENV + echo IS_MAIN_IMAGE=false >> $GITHUB_ENV - name: Is dev image - if: ${{ contains(github.ref, 'develop') && github.event_name == 'push' && matrix.app == 'trading' }} + if: ${{ github.ref_name == 'develop' && github.event_name == 'push' && matrix.app == 'trading' }} run: | echo IS_DEV_IMAGE=true >> $GITHUB_ENV + - name: Is main image + if: ${{ github.ref_name == 'main' && github.event_name == 'push' && matrix.app == 'trading' }} + run: | + echo IS_MAIN_IMAGE=true >> $GITHUB_ENV + - name: Is PR if: ${{ github.event_name == 'pull_request' }} run: | @@ -81,7 +87,7 @@ jobs: - name: Log in to the Container registry (docker hub) uses: docker/login-action@v2 - if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' }} + if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' || env.IS_MAIN_IMAGE == 'true' }} with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -179,7 +185,7 @@ jobs: uses: docker/build-push-action@v3 continue-on-error: true id: dockerhub-push - if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' }} + if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' || env.IS_MAIN_IMAGE == 'true' }} with: context: . file: docker/node-outside-docker.Dockerfile @@ -189,7 +195,7 @@ jobs: ENV_NAME=${{ env.ENV_NAME }} tags: | vegaprotocol/${{ matrix.app }}:${{ github.sha }} - vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || env.IS_DEV_IMAGE == 'true' && 'develop' || '' }} + vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || env.IS_DEV_IMAGE == 'true' && 'develop' || env.IS_MAIN_IMAGE == 'true && main' || '' }} - name: Publish dist as docker image (ghcr - retry) uses: docker/build-push-action@v3 @@ -216,7 +222,7 @@ jobs: ENV_NAME=${{ env.ENV_NAME }} tags: | vegaprotocol/${{ matrix.app }}:${{ github.sha }} - vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || '' }} + vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || env.IS_DEV_IMAGE == 'true' && 'develop' || env.IS_MAIN_IMAGE == 'true && main' || '' }} # bucket creation in github.com/vegaprotocol/terraform//frontend - name: Publish dist to s3