From adb4a21898d21d7bbf666c820f3d519f86388349 Mon Sep 17 00:00:00 2001 From: jossduff Date: Thu, 24 Oct 2024 14:29:34 -0400 Subject: [PATCH] feat: upload image to Digital Ocean --- .github/workflows/build-docker-image.yml | 27 -------------- .github/workflows/docker-image.yml | 45 ++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/build-docker-image.yml create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/build-docker-image.yml b/.github/workflows/build-docker-image.yml deleted file mode 100644 index 91f9675ef3..0000000000 --- a/.github/workflows/build-docker-image.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Build op-geth Docker Image - -on: - push: - branches: - - optimism - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Build Docker image - uses: docker/build-push-action@v5 - with: - context: . - file: ./Dockerfile - push: false - tags: op-geth:latest - cache-from: type=gha - cache-to: type=gha,mode=max diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000000..9c54d1f7bb --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,45 @@ +name: Build and Push op-geth + +on: + push: + branches: + - optimism + +env: + REGISTRY: "registry.digitalocean.com/sigil" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Build container image + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: false + tags: ${{ env.REGISTRY }}/op-geth:${{ github.sha }} + cache-from: type=gha + cache-to: type=gha,mode=max + + - name: Install doctl + uses: digitalocean/action-doctl@v2 + with: + token: ${{ secrets.DIGITALOCEAN_ACCESS_TOKEN }} + + - name: Log in to DO Container Registry + run: doctl registry login --expiry-seconds 1200 + + - name: Push image to DO Container Registry + uses: docker/build-push-action@v5 + with: + context: . + file: ./Dockerfile + push: true + tags: | + ${{ env.REGISTRY }}/op-geth:${{ github.sha }} + ${{ env.REGISTRY }}/op-geth:latest