forked from anon-aadhaar/privado-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
89da491
commit 90f05e8
Showing
2 changed files
with
60 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters