Skip to content

Commit

Permalink
Testing image publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbown committed Oct 17, 2024
1 parent 13002a4 commit 0f8e611
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/coordinator-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/
Expand All @@ -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/
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/postman-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/prover-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 5 additions & 9 deletions .github/workflows/traces-api-facade-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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/
Expand All @@ -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

0 comments on commit 0f8e611

Please sign in to comment.