This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
Merge branch 'main' of https://github.com/klaytn/klaytn-safe-transact… #1
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
name: klaytn-safe-txn deploy workflow | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
permissions: | |
id-token: write | |
contents: read | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout source code | |
uses: actions/checkout@v3 | |
- name: Get AWS credentials | |
uses: aws-actions/configure-aws-credentials@v1 | |
with: | |
role-to-assume: ${{ secrets.AWS_IAM_ROLE_ARN_DEV }} | |
role-session-name: SessionForKlaytnActions | |
aws-region: ${{ secrets.AWS_REGION_DEV }} | |
- name: Login to Amazon ECR | |
uses: aws-actions/amazon-ecr-login@v1 | |
id: login-ecr | |
- name: Build, tag, and push image to Amazon ECR | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY_DEV }} | |
run: | | |
git_hash=$(git rev-parse --short "$GITHUB_SHA") | |
docker build -t $ECR_REPOSITORY:${GITHUB_REF_NAME}.${git_hash} -t $ECR_REPOSITORY:latest -f docker/web/Dockerfile . | |
docker push $ECR_REPOSITORY --all-tags |