Skip to content

Merge pull request #845 from 0xPolygonID/feat/multichain-payment #32

Merge pull request #845 from 0xPolygonID/feat/multichain-payment

Merge pull request #845 from 0xPolygonID/feat/multichain-payment #32

Workflow file for this run

name: Deploy Issuer Node UI to AWS Environment
on:
push:
branches:
- main
- develop
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_DEFAULT_REGION: ${{ secrets.AWS_REGION }}
ECR_REPOSITORY: ${{vars.ECR_REPOSITORY_UI}}
jobs:
deploy:
environment:
name: ${{ github.ref_name }}
name: Build and Deploy UI to Demo AWS Environment
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1-node16
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@v1
id: login-ecr
- name: Get version
run: echo "::set-output name=VERSION::$(git rev-parse --short HEAD)"
id: version
- name: build ui docker image
working-directory: ./ui
env:
IMAGE_TAG: ${{ steps.version.outputs.VERSION }}
run: |
docker build -t polygonid/issuernode_ui:${{ env.IMAGE_TAG }} .
- name: 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 tag polygonid/issuernode_ui:${{ env.IMAGE_TAG }} ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }}
docker tag polygonid/issuernode_ui:${{ env.IMAGE_TAG }} ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest
docker push ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:latest