Skip to content

Commit

Permalink
Try using Docker bake action to build op-node images
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer committed Nov 6, 2023
1 parent d74e512 commit 3d36015
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 45 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/docker-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,36 +33,3 @@ jobs:
context: .
dockerfile: ./ops-bedrock/Dockerfile.stateviz
secrets: inherit

docker-op-node:
uses: ./.github/workflows/docker.yml
with:
images: ghcr.io/espressosystems/op-espresso-integration/op-node
context: .
dockerfile: ./op-node/Dockerfile
secrets: inherit

docker-op-proposer:
uses: ./.github/workflows/docker.yml
with:
images: ghcr.io/espressosystems/op-espresso-integration/op-proposer
context: .
dockerfile: ./op-proposer/Dockerfile
secrets: inherit

docker-op-batcher:
uses: ./.github/workflows/docker.yml
with:
images: ghcr.io/espressosystems/op-espresso-integration/op-batcher
context: .
dockerfile: ./op-batcher/Dockerfile
secrets: inherit

docker-op-geth-proxy:
uses: ./.github/workflows/docker.yml
with:
images: ghcr.io/espressosystems/op-espresso-integration/op-geth-proxy
context: .
dockerfile: ./op-geth-proxy/Dockerfile
secrets: inherit

51 changes: 51 additions & 0 deletions .github/workflows/docker-op-node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: OP Node Docker Images

on:
push:
branches:
- main
- release-*
- integration
pull_request:
workflow_dispatch:

env:
PLATFORMS: linux/amd64,linux/arm64

jobs:
build_and_push_docker_image:
name: Push Docker image to ghcr
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to Github Container Repo
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up environment
run: |
GIT_COMMIT=$(git rev-parse HEAD)
GIT_DATE=$(git show -s --format='%ct')
IMAGE_TAGS=$GIT_COMMIT,latest
echo "GIT_COMMIT=$GIT_COMMIT" >> "$GITHUB_ENV"
echo "GIT_DATE=$GIT_DATE" >> "$GITHUB_ENV"
echo "IMAGE_TAGS=$IMAGE_TAGS" >> "$GITHUB_ENV"
cat "$GITHUB_ENV"
- name: Build and push
uses: docker/bake-action@v4
with:
targets: op-node,op-batcher,op-proposer,op-geth-proxy
push: ${{ github.event_name != 'pull_request' }}
12 changes: 0 additions & 12 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,6 @@ jobs:
with:
images: ${{ inputs.images }}

- name: Build OP stack builder
run: |
GIT_COMMIT=$(git rev-parse HEAD) \
GIT_DATE=$(git show -s --format='%ct') \
IMAGE_TAGS=$GIT_COMMIT,latest \
PLATFORMS=linux/amd64,arm64 \
docker buildx bake \
--progress plain \
--load \
-f docker-bake.hcl \
op-stack-go
- name: Build and push docker
uses: docker/build-push-action@v4
with:
Expand Down

0 comments on commit 3d36015

Please sign in to comment.