Skip to content

Merge pull request #8 from kaiachain/feat/faucet #11

Merge pull request #8 from kaiachain/feat/faucet

Merge pull request #8 from kaiachain/feat/faucet #11

Workflow file for this run

name: kaia-websites-api build image workflow for PROD env
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 }}
role-session-name: SessionforKlaytnWebsitesApi
aws-region: ${{ secrets.AWS_REGION }}
- name: Login to Amazon ECR
uses: aws-actions/amazon-ecr-login@v1
id: login-ecr
- name: Extract commit hash
id: vars
run: echo "::set-output name=hash::$(git rev-parse --short HEAD)"
- name: Build, tag, and push image API to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
ECR_REPOSITORY: ${{ secrets.ECR_REPOSITORY }}
IMAGE_TAG: ${{ steps.vars.outputs.hash }}
run: |
docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG