From f718aac5e7815e7d1c905f37dd412062e6be8d9b Mon Sep 17 00:00:00 2001 From: Epikichi <78609649+epikichi@users.noreply.github.com> Date: Thu, 8 Dec 2022 11:41:31 -0500 Subject: [PATCH] adding in container build/push step (#977) --- .github/workflows/deploy.devnet.eph.yml | 41 +++++++++++++++++++++++++ .github/workflows/deploy.devnet.yml | 41 +++++++++++++++++++++++++ .github/workflows/deploy.testnet.yml | 41 +++++++++++++++++++++++++ 3 files changed, 123 insertions(+) diff --git a/.github/workflows/deploy.devnet.eph.yml b/.github/workflows/deploy.devnet.eph.yml index 663261d9a7..98c2029dcf 100644 --- a/.github/workflows/deploy.devnet.eph.yml +++ b/.github/workflows/deploy.devnet.eph.yml @@ -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 diff --git a/.github/workflows/deploy.devnet.yml b/.github/workflows/deploy.devnet.yml index 9e519c4a4d..9e0cbbe0bc 100644 --- a/.github/workflows/deploy.devnet.yml +++ b/.github/workflows/deploy.devnet.yml @@ -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 diff --git a/.github/workflows/deploy.testnet.yml b/.github/workflows/deploy.testnet.yml index dd1eca6193..41ef736878 100644 --- a/.github/workflows/deploy.testnet.yml +++ b/.github/workflows/deploy.testnet.yml @@ -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