From 90f05e8041a875bfc28cdff517fd4aea54233de8 Mon Sep 17 00:00:00 2001 From: ilya-korotya Date: Fri, 8 Nov 2024 12:06:23 +0100 Subject: [PATCH] deployment --- .github/workflows/push-backend-erc.yaml | 57 ++++++++++++++++++++++++ .github/workflows/push-frontend-erc.yaml | 6 +-- 2 files changed, 60 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/push-backend-erc.yaml diff --git a/.github/workflows/push-backend-erc.yaml b/.github/workflows/push-backend-erc.yaml new file mode 100644 index 0000000..a9527ad --- /dev/null +++ b/.github/workflows/push-backend-erc.yaml @@ -0,0 +1,57 @@ +name: Push anon aadhaar non merklized backend to AWS ECR + +on: + workflow_dispatch: + push: + branches: + - main + +env: + AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_PRIVADO_ID }} + AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION_PRIVADO_ID }} + ECR_REPOSITORY: anon-aadhaar-non-merklized_issuer_backend_demo + +jobs: + deploy: + environment: + name: ${{ github.ref_name }} + name: Build and deploy anon aadhaar non merklized issuer backend to AWS ECR + runs-on: ubuntu-latest + permissions: + id-token: write + contents: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 16 + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-region: ${{ env.AWS_DEFAULT_REGION }} + role-to-assume: arn:aws:iam::${{ env.AWS_ACCOUNT_ID }}:role/PolygonIDActionsRole + role-session-name: GitHubActionsSession + + - name: Login to Amazon ECR + uses: aws-actions/amazon-ecr-login@v2 + id: login-ecr + + - name: Get version + run: echo "::set-output name=VERSION::$(git rev-parse --short HEAD)" + id: version + + - name: Build with tag and push image + env: + ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} + ECR_REPOSITORY: ${{ env.ECR_REPOSITORY }} + IMAGE_TAG: ${{ steps.version.outputs.VERSION }} + run: | + docker build \ + -t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest \ + -t ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} . + + docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} + docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest \ No newline at end of file diff --git a/.github/workflows/push-frontend-erc.yaml b/.github/workflows/push-frontend-erc.yaml index 0daa64a..9933a0e 100644 --- a/.github/workflows/push-frontend-erc.yaml +++ b/.github/workflows/push-frontend-erc.yaml @@ -1,4 +1,4 @@ -name: Push onchain non merklized frontend to AWS ECR +name: Push anon aadhaar non merklized frontend to AWS ECR on: workflow_dispatch: @@ -9,7 +9,7 @@ on: env: AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID_PRIVADO_ID }} AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION_PRIVADO_ID }} - ECR_REPOSITORY: onchain_non_merklized_issuer_frontend_demo + ECR_REPOSITORY: anon-aadhaar-non-merklized_issuer_frontend_demo NEXT_PUBLIC_ISSUER_URL: ${{ vars.NEXT_PUBLIC_ISSUER_URL }} NEXT_PUBLIC_NULLIFIER_SEED: ${{ vars.NEXT_PUBLIC_NULLIFIER_SEED }} @@ -17,7 +17,7 @@ jobs: deploy: environment: name: ${{ github.ref_name }} - name: Build and deploy ochain non merklized issuer frontend to AWS ECR + name: Build and deploy anon aadhaar non merklized issuer frontend to AWS ECR runs-on: ubuntu-latest permissions: id-token: write