Skip to content

Commit

Permalink
Only login to docker on main
Browse files Browse the repository at this point in the history
  • Loading branch information
bradbown committed Oct 18, 2024
1 parent d25b6af commit 52cef4a
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 37 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/coordinator-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
file: ./coordinator/Dockerfile
platforms: linux/amd64
load: true
push: ${{ env.PUSH_IMAGE }}
push: false
tags: ${{ env.TAGS }}
- name: Save Docker image as artifact
if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }}
Expand All @@ -105,7 +105,7 @@ jobs:
build-contexts: zip=./coordinator/app/build/distributions/
file: ./coordinator/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ env.PUSH_IMAGE }}
push: true
tags: ${{ env.TAGS }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
25 changes: 10 additions & 15 deletions .github/workflows/postman-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ on:
default: false
secrets:
DOCKERHUB_USERNAME:
required: true
required: false
DOCKERHUB_TOKEN:
required: true
required: false
workflow_dispatch:
inputs:
push_image:
Expand Down Expand Up @@ -54,11 +54,6 @@ jobs:
ssh-key: ${{ secrets.SELF_GITHUB_SSH_KEY }}
submodules: true
persist-credentials: false
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
Expand All @@ -77,14 +72,8 @@ jobs:
file: ./sdk/Dockerfile
platforms: linux/amd64
load: true
push: ${{ env.PUSH_IMAGE }}
push: false
tags: ${{ env.TAGS }}
cache-from: |
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-amd64,platform=linux/amd64
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-arm64,platform=linux/arm64
cache-to: |
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-amd64,mode=max,platform=linux/amd64
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-arm64,mode=max,platform=linux/arm64
build-args: |
NATIVE_LIBS_RELEASE_TAG=blob-libs-v1.0.1
- name: Save Docker image as artifact
Expand All @@ -98,14 +87,20 @@ jobs:
with:
name: linea-postman
path: linea-postman.tar.gz
- name: Login to Docker Hub
if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push postman image
uses: docker/build-push-action@v6
if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }}
with:
context: ./
file: ./sdk/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ env.PUSH_IMAGE }}
push: true
tags: ${{ env.TAGS }}
cache-from: |
type=registry,ref=${{ env.IMAGE_NAME }}:buildcache-amd64,platform=linux/amd64
Expand Down
40 changes: 29 additions & 11 deletions .github/workflows/prover-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ on:
default: false
secrets:
DOCKERHUB_USERNAME:
required: true
required: false
DOCKERHUB_TOKEN:
required: true
required: false
workflow_dispatch:
inputs:
push_image:
Expand Down Expand Up @@ -57,11 +57,6 @@ jobs:
ssh-key: ${{ secrets.SELF_GITHUB_SSH_KEY }}
submodules: true
persist-credentials: false
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Show the "version" build argument
Expand All @@ -70,6 +65,7 @@ jobs:
echo COMMIT_TAG=${{ env.COMMIT_TAG }} >> $GITHUB_ENV
- name: Build and push prover image
uses: docker/build-push-action@v6
if: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }}
with:
context: .
file: ./prover/Dockerfile
Expand All @@ -80,11 +76,9 @@ jobs:
corset=corset/
constraints=constraints/
platforms: linux/amd64
load: ${{ env.PUSH_IMAGE == 'false' }}
push: ${{ env.PUSH_IMAGE }}
load: true
push: false
tags: ${{ env.TAGS }}
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: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }}
run: |
Expand All @@ -96,3 +90,27 @@ jobs:
with:
name: linea-prover
path: linea-prover.tar.gz
- name: Login to Docker Hub
if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build and push prover image
uses: docker/build-push-action@v6
if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }}
with:
context: .
file: ./prover/Dockerfile
build-args: |
RUSTFLAGS="-C target-cpu=x86-64-v3"
build-contexts: |
prover=prover/
corset=corset/
constraints=constraints/
platforms: linux/amd64
load: false
push: true
tags: ${{ env.TAGS }}
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache,mode=max
17 changes: 8 additions & 9 deletions .github/workflows/traces-api-facade-build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ on:
default: false
secrets:
DOCKERHUB_USERNAME:
required: true
required: false
DOCKERHUB_TOKEN:
required: true
required: false
workflow_dispatch:
inputs:
push_image:
Expand Down Expand Up @@ -63,11 +63,6 @@ jobs:
run: |
./gradlew traces-api-facade:app:shadowJar
echo ${{ github.workspace }}
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
Expand All @@ -89,8 +84,6 @@ jobs:
load: true
push: ${{ env.PUSH_IMAGE }}
tags: ${{ env.TAGS }}
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: ${{ env.PUSH_IMAGE == 'false' && github.event_name == 'pull_request' }}
run: |
Expand All @@ -102,6 +95,12 @@ jobs:
with:
name: linea-traces-api-facade
path: linea-traces-api-facade.tar.gz
- name: Login to Docker Hub
if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }}
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build & push
uses: docker/build-push-action@v6
if: ${{ env.PUSH_IMAGE == 'true' || github.event_name == 'workflow_dispatch' }}
Expand Down

0 comments on commit 52cef4a

Please sign in to comment.