Skip to content

Commit

Permalink
dockerhub
Browse files Browse the repository at this point in the history
  • Loading branch information
wo-o committed Oct 25, 2024
1 parent 9f1835f commit 7b90a36
Showing 1 changed file with 11 additions and 18 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/ci-docker-hub-geth.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and Upload geth Binary to ECR
name: Build and Push to Docker Hub

on:
workflow_dispatch:
Expand All @@ -8,50 +8,43 @@ on:

env:
DOCKERHUB_REPOSITORY: jinnuae40/story-geth
NETWORK: iliad

jobs:
# Build and upload the geth binary
build_and_push:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
- uses: actions/checkout@v4

- name: Set build arguments
run: |
- run: |
echo "COMMIT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo "VERSION=$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV
echo "BUILDNUM=$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
echo "REPOSITORY_URI=$DOCKERHUB_REPOSITORY" >> $GITHUB_ENV
echo "NETWORK=$NETWORK" >> $GITHUB_ENV
- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v1
- uses: docker/setup-buildx-action@v2

- name: Cache Docker layers
uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
restore-keys: ${{ runner.os }}-buildx-

- name: Log in to Docker Hub
uses: docker/login-action@v2
- uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Dockerize the geth and bootnode binary
env:
DOCKER_BUILDKIT: 1
run: |
- run: |
docker buildx create --use
docker buildx build \
--platform linux/amd64,linux/arm64,linux/arm64/v8 \
--build-arg COMMIT=$COMMIT \
--build-arg VERSION=$VERSION \
--build-arg BUILDNUM=$BUILDNUM \
--build-arg NETWORK=$NETWORK \
-t $REPOSITORY_URI:latest \
-t $REPOSITORY_URI:$COMMIT \
-t $REPOSITORY_URI:$VERSION \
Expand Down

0 comments on commit 7b90a36

Please sign in to comment.