Skip to content

Commit

Permalink
adding in container build/push step (0xPolygon#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
epikichi authored Dec 8, 2022
1 parent 4eafc19 commit f718aac
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/deploy.devnet.eph.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,47 @@ jobs:
secrets:
GH_TOKEN_CLONE_PRIVATE: ${{ secrets.GH_TOKEN_CLONE_PRIVATE }}

container_image_build:
name: Build/Push Container Image
runs-on: ubuntu-latest
environment: devnet-ephemeral
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download Polygon Edge Artifact
uses: actions/download-artifact@v3
with:
name: polygon-edge
- run: tar -xvzf polygon-edge.tar.gz

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

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

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: library/polygon-edge
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:devnet-ephemeral -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f Dockerfile.release .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:devnet-ephemeral
deploy_eph_devnet:
name: Deploy Ephemeral DevNet
needs: build
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/deploy.devnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,47 @@ jobs:
uses: ./.github/workflows/test.yml
needs: build

container_image_build:
name: Build/Push Container Image
runs-on: ubuntu-latest
environment: devnet
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download Polygon Edge Artifact
uses: actions/download-artifact@v3
with:
name: polygon-edge
- run: tar -xvzf polygon-edge.tar.gz

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

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

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: library/polygon-edge
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:devnet -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f Dockerfile.release .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:devnet
deploy_devnet:
name: Deploy DevNet
needs: build
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/deploy.testnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,47 @@ jobs:
name: Test
needs: build

container_image_build:
name: Build/Push Container Image
runs-on: ubuntu-latest
environment: testnet
needs: build
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Download Polygon Edge Artifact
uses: actions/download-artifact@v3
with:
name: polygon-edge
- run: tar -xvzf polygon-edge.tar.gz

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

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

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: ${{ secrets.AWS_ROLE_ARN }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- name: Build, tag, and push docker image to Amazon ECR
env:
REGISTRY: ${{ steps.login-ecr.outputs.registry }}
REPOSITORY: library/polygon-edge
IMAGE_TAG: ${{ github.sha }}
run: |
docker build -t $REGISTRY/$REPOSITORY:testnet -t $REGISTRY/$REPOSITORY:$IMAGE_TAG -f Dockerfile.release .
docker push $REGISTRY/$REPOSITORY:$IMAGE_TAG
docker push $REGISTRY/$REPOSITORY:testnet
deploy_testnet:
name: Update TestNet
needs: build
Expand Down

0 comments on commit f718aac

Please sign in to comment.