diff --git a/.github/workflows/coordinator-build-and-publish.yml b/.github/workflows/coordinator-build-and-publish.yml index 23c6321d..b4bec8ed 100644 --- a/.github/workflows/coordinator-build-and-publish.yml +++ b/.github/workflows/coordinator-build-and-publish.yml @@ -47,7 +47,7 @@ jobs: - name: Set develop tag if main branch if: ${{ github.ref == 'refs/heads/main' }} run: | - echo "TAGS=${{ inputs.image_name }}:${{ inputs.commit_tag }},${{ inputs.image_name }}:${{ inputs.develop_tag }}" >> $GITHUB_ENV + echo "TAGS=" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v4 - uses: actions/setup-java@v4 @@ -76,7 +76,7 @@ jobs: images: ${{ env.IMAGE_NAME }} - name: Build for testing uses: docker/build-push-action@v6 - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} with: context: . build-contexts: zip=./coordinator/app/build/distributions/ @@ -88,19 +88,19 @@ jobs: cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max - name: Save Docker image as artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} run: | docker save ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }} | gzip > linea-coordinator.tar.gz shell: bash - name: Upload artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} uses: actions/upload-artifact@v4 with: name: linea-coordinator path: linea-coordinator.tar.gz - name: Build & push uses: docker/build-push-action@v6 - if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }} with: context: . build-contexts: zip=./coordinator/app/build/distributions/ diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4e175d67..b17383c8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -184,7 +184,7 @@ jobs: publish-images-after-run-tests-success-on-main: needs: [ store-image-name-and-tags, testing, run-e2e-tests, run-e2e-tests-geth-tracing ] - if: ${{ always() && github.ref == 'refs/heads/main' && needs.testing.result == 'success' && needs.run-e2e-tests.outputs.tests_outcome == 'success' && needs.run-e2e-tests-geth-tracing.outputs.tests_outcome == 'success' }} + if: ${{ always() && github.ref != 'refs/heads/main' && needs.testing.result == 'success' && needs.run-e2e-tests.outputs.tests_outcome == 'success' && needs.run-e2e-tests-geth-tracing.outputs.tests_outcome == 'success' }} uses: ./.github/workflows/build-and-publish.yml with: push_image: true diff --git a/.github/workflows/postman-build-and-publish.yml b/.github/workflows/postman-build-and-publish.yml index e8d1882b..71790c49 100644 --- a/.github/workflows/postman-build-and-publish.yml +++ b/.github/workflows/postman-build-and-publish.yml @@ -88,19 +88,19 @@ jobs: build-args: | NATIVE_LIBS_RELEASE_TAG=blob-libs-v1.0.1 - name: Save Docker image as artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} run: | docker save ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }} | gzip > linea-postman.tar.gz shell: bash - name: Upload artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} uses: actions/upload-artifact@v4 with: name: linea-postman path: linea-postman.tar.gz - name: Build and push postman image uses: docker/build-push-action@v6 - if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }} with: context: ./ file: ./sdk/Dockerfile diff --git a/.github/workflows/prover-build-and-publish.yml b/.github/workflows/prover-build-and-publish.yml index 77af112f..44eb9caf 100644 --- a/.github/workflows/prover-build-and-publish.yml +++ b/.github/workflows/prover-build-and-publish.yml @@ -86,12 +86,12 @@ jobs: cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max - name: Save Docker image as artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} run: | docker save ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }} | gzip > linea-prover.tar.gz shell: bash - name: Upload artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} uses: actions/upload-artifact@v4 with: name: linea-prover diff --git a/.github/workflows/traces-api-facade-build-and-publish.yml b/.github/workflows/traces-api-facade-build-and-publish.yml index 49c87016..13081ff1 100644 --- a/.github/workflows/traces-api-facade-build-and-publish.yml +++ b/.github/workflows/traces-api-facade-build-and-publish.yml @@ -44,10 +44,6 @@ jobs: PUSH_IMAGE: ${{ inputs.push_image }} TAGS: ${{ inputs.image_name }}:${{ inputs.commit_tag }} steps: - - name: Set develop tag if main branch - if: ${{ github.ref == 'refs/heads/main' }} - run: | - echo "TAGS=${{ inputs.image_name }}:${{ inputs.commit_tag }},${{ inputs.image_name }}:${{ inputs.develop_tag }}" >> $GITHUB_ENV - name: Checkout uses: actions/checkout@v3 with: @@ -80,7 +76,7 @@ jobs: images: consensys/linea-traces-api-facade - name: Build for testing uses: docker/build-push-action@v6 - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} with: context: . build-contexts: jar=./traces-api-facade/app/build/libs/ @@ -92,25 +88,25 @@ jobs: cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max - name: Save Docker image as artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} run: | docker save ${{ env.IMAGE_NAME }}:${{ env.COMMIT_TAG }} | gzip > linea-traces-api-facade.tar.gz shell: bash - name: Upload artifact - if: ${{ github.event_name == 'pull_request' }} + if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }} uses: actions/upload-artifact@v4 with: name: linea-traces-api-facade path: linea-traces-api-facade.tar.gz - name: Build & push uses: docker/build-push-action@v6 - if: ${{ github.event_name == 'workflow_dispatch' }} + if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }} with: context: . build-contexts: jar=./traces-api-facade/app/build/libs/ file: ./traces-api-facade/Dockerfile platforms: linux/amd64,linux/arm64 push: ${{ env.PUSH_IMAGE }} - tags: ${{ env.TAGS }} + tags: ${{ inputs.image_name }}:${{ inputs.commit_tag }},${{ inputs.image_name }}:${{ inputs.develop_tag }} cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max