mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-09 14:08:03 -05:00
feat: push image to ecr and docekrhub (#1090)
Co-authored-by: johnsonjie <xiaojie@scroll.io>
This commit is contained in:
249
.github/workflows/docker.yml
vendored
249
.github/workflows/docker.yml
vendored
@@ -5,6 +5,9 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- v**
|
- v**
|
||||||
|
|
||||||
|
env:
|
||||||
|
AWS_REGION: us-west-2
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
event_watcher:
|
event_watcher:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -29,6 +32,29 @@ jobs:
|
|||||||
scrolltech/event-watcher:latest
|
scrolltech/event-watcher:latest
|
||||||
# cache-from: type=gha,scope=${{ github.workflow }}
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
# cache-to: type=gha,scope=${{ github.workflow }}
|
# cache-to: type=gha,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
# build and push to aws ecr
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a
|
||||||
|
- name: Build, tag, and push image to Amazon ECR
|
||||||
|
id: build-image
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
ECR_REPOSITORY: event-watcher
|
||||||
|
IMAGE_TAG: ${{github.ref_name}}
|
||||||
|
run: |
|
||||||
|
# Build a docker container and push it to ECR
|
||||||
|
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
|
||||||
gas_oracle:
|
gas_oracle:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -52,6 +78,30 @@ jobs:
|
|||||||
scrolltech/gas-oracle:latest
|
scrolltech/gas-oracle:latest
|
||||||
# cache-from: type=gha,scope=${{ github.workflow }}
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
# cache-to: type=gha,scope=${{ github.workflow }}
|
# cache-to: type=gha,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
# build and push to aws ecr
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a
|
||||||
|
|
||||||
|
- name: Build, tag, and push image to Amazon ECR
|
||||||
|
id: build-image
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
ECR_REPOSITORY: gas-oracle
|
||||||
|
IMAGE_TAG: ${{github.ref_name}}
|
||||||
|
run: |
|
||||||
|
# Build a docker container and push it to ECR
|
||||||
|
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
|
||||||
rollup_relayer:
|
rollup_relayer:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -75,52 +125,124 @@ jobs:
|
|||||||
scrolltech/rollup-relayer:latest
|
scrolltech/rollup-relayer:latest
|
||||||
# cache-from: type=gha,scope=${{ github.workflow }}
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
# cache-to: type=gha,scope=${{ github.workflow }}
|
# cache-to: type=gha,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
# build and push to aws ecr
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a
|
||||||
|
|
||||||
|
- name: Build, tag, and push image to Amazon ECR
|
||||||
|
id: build-image
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
ECR_REPOSITORY: rollup-relayer
|
||||||
|
IMAGE_TAG: ${{github.ref_name}}
|
||||||
|
run: |
|
||||||
|
# Build a docker container and push it to ECR
|
||||||
|
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
|
||||||
bridgehistoryapi-fetcher:
|
bridgehistoryapi-fetcher:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push bridgehistoryapi-fetcher docker
|
- name: Build and push bridgehistoryapi-fetcher docker
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./build/dockerfiles/bridgehistoryapi-fetcher.Dockerfile
|
file: ./build/dockerfiles/bridgehistoryapi-fetcher.Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
scrolltech/bridgehistoryapi-fetcher:${{github.ref_name}}
|
scrolltech/bridgehistoryapi-fetcher:${{github.ref_name}}
|
||||||
scrolltech/bridgehistoryapi-fetcher:latest
|
scrolltech/bridgehistoryapi-fetcher:latest
|
||||||
# cache-from: type=gha,scope=${{ github.workflow }}
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
# cache-to: type=gha,scope=${{ github.workflow }}
|
# cache-to: type=gha,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
# build and push to aws ecr
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a
|
||||||
|
|
||||||
|
- name: Build, tag, and push image to Amazon ECR
|
||||||
|
id: build-image
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
ECR_REPOSITORY: bridgehistoryapi-fetcher
|
||||||
|
IMAGE_TAG: ${{github.ref_name}}
|
||||||
|
run: |
|
||||||
|
# Build a docker container and push it to ECR
|
||||||
|
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
|
||||||
bridgehistoryapi-api:
|
bridgehistoryapi-api:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: docker/setup-buildx-action@v2
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
- name: Build and push bridgehistoryapi-api docker
|
- name: Build and push bridgehistoryapi-api docker
|
||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./build/dockerfiles/bridgehistoryapi-api.Dockerfile
|
file: ./build/dockerfiles/bridgehistoryapi-api.Dockerfile
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
scrolltech/bridgehistoryapi-api:${{github.ref_name}}
|
scrolltech/bridgehistoryapi-api:${{github.ref_name}}
|
||||||
scrolltech/bridgehistoryapi-api:latest
|
scrolltech/bridgehistoryapi-api:latest
|
||||||
# cache-from: type=gha,scope=${{ github.workflow }}
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
# cache-to: type=gha,scope=${{ github.workflow }}
|
# cache-to: type=gha,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
# build and push to aws ecr
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a
|
||||||
|
|
||||||
|
- name: Build, tag, and push image to Amazon ECR
|
||||||
|
id: build-image
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
ECR_REPOSITORY: bridgehistoryapi-api
|
||||||
|
IMAGE_TAG: ${{github.ref_name}}
|
||||||
|
run: |
|
||||||
|
# Build a docker container and push it to ECR
|
||||||
|
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
|
||||||
coordinator-api:
|
coordinator-api:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -144,6 +266,30 @@ jobs:
|
|||||||
scrolltech/coordinator-api:latest
|
scrolltech/coordinator-api:latest
|
||||||
# cache-from: type=gha,scope=${{ github.workflow }}
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
# cache-to: type=gha,scope=${{ github.workflow }}
|
# cache-to: type=gha,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
# build and push to aws ecr
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a
|
||||||
|
|
||||||
|
- name: Build, tag, and push image to Amazon ECR
|
||||||
|
id: build-image
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
ECR_REPOSITORY: coordinator-api
|
||||||
|
IMAGE_TAG: ${{github.ref_name}}
|
||||||
|
run: |
|
||||||
|
# Build a docker container and push it to ECR
|
||||||
|
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
|
||||||
coordinator-cron:
|
coordinator-cron:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -167,3 +313,26 @@ jobs:
|
|||||||
scrolltech/coordinator-cron:latest
|
scrolltech/coordinator-cron:latest
|
||||||
# cache-from: type=gha,scope=${{ github.workflow }}
|
# cache-from: type=gha,scope=${{ github.workflow }}
|
||||||
# cache-to: type=gha,scope=${{ github.workflow }}
|
# cache-to: type=gha,scope=${{ github.workflow }}
|
||||||
|
|
||||||
|
# build and push to aws ecr
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@0e613a0980cbf65ed5b322eb7a1e075d28913a83
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
- name: Login to Amazon ECR
|
||||||
|
id: login-ecr
|
||||||
|
uses: aws-actions/amazon-ecr-login@62f4f872db3836360b72999f4b87f1ff13310f3a
|
||||||
|
|
||||||
|
- name: Build, tag, and push image to Amazon ECR
|
||||||
|
id: build-image
|
||||||
|
env:
|
||||||
|
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
|
||||||
|
ECR_REPOSITORY: coordinator-cron
|
||||||
|
IMAGE_TAG: ${{github.ref_name}}
|
||||||
|
run: |
|
||||||
|
# Build a docker container and push it to ECR
|
||||||
|
# docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
|
||||||
|
docker tag scrolltech/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
|
||||||
|
|||||||
Reference in New Issue
Block a user