mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 23:26:44 +00:00
feat: deploy image to AWS ECR
This commit is contained in:
parent
5c2053c78d
commit
e0e6fe9309
1 changed files with 27 additions and 17 deletions
40
.github/workflows/docker-build.yml
vendored
40
.github/workflows/docker-build.yml
vendored
|
|
@ -4,27 +4,37 @@ on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [closed]
|
types: [closed]
|
||||||
|
|
||||||
|
env:
|
||||||
|
AWS_REGION: ${{ vars.AWS_REGION }}
|
||||||
|
REPO_URL: ${{ vars.REPO_URL }}
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build')
|
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'CI:Build')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Setup AWS CLI credentials
|
||||||
uses: docker/setup-buildx-action@v2
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
|
||||||
|
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
aws-region: ${{ env.AWS_REGION }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Login to Amazon ECR
|
||||||
uses: docker/build-push-action@v4
|
run: aws ecr get-login-password --region ${{ env.AWS_REGION }} | docker login --username AWS --password-stdin ${{ env.REPO_URL }}
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: false
|
|
||||||
tags: ethereum/client-go:latest
|
|
||||||
load: true
|
|
||||||
cache-from: type=gha,scope=go-ethereum
|
|
||||||
cache-to: type=gha,mode=max,scope=go-ethereum
|
|
||||||
|
|
||||||
- name: Test Docker image
|
- name: Build and push Docker image
|
||||||
run: docker run --rm ethereum/client-go:latest version
|
uses: docker/build-push-action@v5
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
push: true
|
||||||
|
tags: ${{ env.REPO_URL }}/limechain/geth:latest
|
||||||
|
|
||||||
|
- name: Test Docker image
|
||||||
|
run: docker run --rm ethereum/client-go:latest version
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue